Function: helpful--format-keys

helpful--format-keys is a byte-compiled function defined in helpful.el.

Signature

(helpful--format-keys COMMAND-SYM ALIASES)

Documentation

Describe all the keys that call COMMAND-SYM.

This function has :before-until advice: helpful--format-keys@fast-no-keys.

Source Code

;; Defined in ~/.emacs.d/elpa/helpful-20250408.334/helpful.el
(defun helpful--format-keys (command-sym aliases)
  "Describe all the keys that call COMMAND-SYM."
  (let (mode-lines
        global-lines)
    (--each (helpful--keymaps-containing-aliases command-sym aliases)
      (-let [(map . keys) it]
        (dolist (key keys)
          (push
           (format "%s %s"
                   (propertize map 'face 'font-lock-variable-name-face)
                   (if (>= emacs-major-version 28)
                       (propertize key 'face 'help-key-binding)
                     key))
           (if (eq map 'global-map) global-lines mode-lines)))))
    (setq global-lines (-sort #'string< global-lines))
    (setq mode-lines (-sort #'string< mode-lines))
    (-let [lines (-concat global-lines mode-lines)]
      (if lines
          (s-join "\n" lines)
        "This command is not in any keymaps."))))