Function: shortdoc-display-group

shortdoc-display-group is an autoloaded, interactive and byte-compiled function defined in shortdoc.el.gz.

Signature

(shortdoc-display-group GROUP &optional FUNCTION SAME-WINDOW)

Documentation

Pop to a buffer with short documentation summary for functions in GROUP.

If FUNCTION is non-nil, place point on the entry for FUNCTION (if any). If SAME-WINDOW, don't pop to a new window.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Aliases

shortdoc

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/shortdoc.el.gz
;;;###autoload
(defun shortdoc-display-group (group &optional function same-window)
  "Pop to a buffer with short documentation summary for functions in GROUP.
If FUNCTION is non-nil, place point on the entry for FUNCTION (if any).
If SAME-WINDOW, don't pop to a new window."
  (interactive (list (completing-read "Show summary for functions in: "
                                      (mapcar #'car shortdoc--groups))))
  (when (stringp group)
    (setq group (intern group)))
  (unless (assq group shortdoc--groups)
    (error "No such documentation group %s" group))
  (funcall (if same-window
               #'pop-to-buffer-same-window
             #'pop-to-buffer)
           (format "*Shortdoc %s*" group))
  (let ((inhibit-read-only t)
        (prev nil))
    (erase-buffer)
    (shortdoc-mode)
    (button-mode)
    (mapc
     (lambda (data)
       (cond
        ((stringp data)
         (setq prev nil)
         (unless (bobp)
           (insert "\n"))
         (insert (propertize
                  (substitute-command-keys data)
                  'face 'shortdoc-heading
                  'shortdoc-section t
                  'outline-level 1))
         (insert (propertize
                  "\n\n"
                  'face 'shortdoc-heading
                  'shortdoc-section t)))
        ;; There may be functions not yet defined in the data.
        ((fboundp (car data))
         (when prev
           (insert (make-separator-line)
                   ;; This helps with hidden outlines (bug#53981)
                   (propertize "\n" 'face '(:height 0))))
         (setq prev t)
         (shortdoc--display-function data))))
     (cdr (assq group shortdoc--groups))))
  (goto-char (point-min))
  (when function
    (text-property-search-forward 'shortdoc-function function t)
    (beginning-of-line)))