Function: magit-menu-format-desc

magit-menu-format-desc is a byte-compiled function defined in magit-section.el.

Signature

(magit-menu-format-desc FORMAT)

Documentation

Format a string based on FORMAT and menu section or selection.

The following %-specs are allowed:
%t means "TYPE".
%T means "TYPE", or "TYPEs" if multiple sections are selected.
%v means "VALUE".
%s means "TYPE VALUE".
%m means "TYPE VALUE", or "COUNT TYPEs" if multiple sections
   are selected.
%M means "VALUE", or "COUNT TYPEs" if multiple sections are
   selected.
%x means the value of magit-menu-common-value(var)/magit-menu-common-value(fun).

Source Code

;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defun magit-menu-format-desc (format)
  "Format a string based on FORMAT and menu section or selection.
The following %-specs are allowed:
%t means \"TYPE\".
%T means \"TYPE\", or \"TYPEs\" if multiple sections are selected.
%v means \"VALUE\".
%s means \"TYPE VALUE\".
%m means \"TYPE VALUE\", or \"COUNT TYPEs\" if multiple sections
   are selected.
%M means \"VALUE\", or \"COUNT TYPEs\" if multiple sections are
   selected.
%x means the value of `magit-menu-common-value'."
  (pcase-let* ((`(,type ,value ,single ,count ,suffix) magit-menu--desc-values)
               (multiple (and count (format "%s %s%s" count type suffix))))
    (format-spec format
                 `((?t . ,type)
                   (?T . ,(format "%s%s" type (if count suffix "")))
                   (?v . ,value)
                   (?s . ,single)
                   (?m . ,(or multiple single))
                   (?M . ,(or multiple value))
                   (?x . ,(format "%s" magit-menu-common-value))))))