Function: transient-command-summary-or-name

transient-command-summary-or-name is a byte-compiled function defined in transient.el.

Signature

(transient-command-summary-or-name OBJ)

Documentation

Return the summary or name of the command represented by OBJ.

If the command has a doc-string, then return the first line of that, else its name.

Intended to be temporarily used as the :suffix-description of a prefix command, while porting a regular keymap to a transient.

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
(defun transient-command-summary-or-name (obj)
  "Return the summary or name of the command represented by OBJ.

If the command has a doc-string, then return the first line of
that, else its name.

Intended to be temporarily used as the `:suffix-description' of
a prefix command, while porting a regular keymap to a transient."
  (let ((command (oref obj command)))
    (if-let ((doc (documentation command)))
        (propertize (car (split-string doc "\n")) 'face 'font-lock-doc-face)
      (propertize (symbol-name command) 'face 'font-lock-function-name-face))))