Function: which-key--safe-lookup-key-description

which-key--safe-lookup-key-description is a byte-compiled function defined in which-key.el.gz.

Signature

(which-key--safe-lookup-key-description KEYMAP KEY)

Documentation

Version of lookup-key that allows KEYMAP to be nil.

Also convert numeric results of lookup-key to nil. KEY should be formatted as an input for kbd.

Source Code

;; Defined in /usr/src/emacs/lisp/which-key.el.gz
(defsubst which-key--safe-lookup-key-description (keymap key)
  "Version of `lookup-key' that allows KEYMAP to be nil.
Also convert numeric results of `lookup-key' to nil.
KEY should be formatted as an input for `kbd'."
  (let ((key (ignore-errors (kbd key))))
    (when (and key (keymapp keymap))
      (let ((result (lookup-key keymap key)))
        (when (and result (not (numberp result)))
          result)))))