Function: helpful--format-keys
helpful--format-keys is a natively compiled function defined in
helpful.el.
Signature
(helpful--format-keys COMMAND-SYM ALIASES)
Documentation
Describe all the keys that call COMMAND-SYM.
Source Code
;; Defined in /nix/store/mvfc1hll8a1f23ivm3qmzj4bn64jr3x7-emacs-packages-deps/share/emacs/site-lisp/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."))))