Function: help--key-binding-keymap
help--key-binding-keymap is a byte-compiled function defined in
help.el.gz.
Signature
(help--key-binding-keymap KEY &optional ACCEPT-DEFAULT NO-REMAP POSITION)
Documentation
Return a keymap holding a binding for KEY within current keymaps.
The effect of the arguments KEY, ACCEPT-DEFAULT, NO-REMAP and
POSITION is as documented in the function key-binding.
Source Code
;; Defined in /usr/src/emacs/lisp/help.el.gz
(defun help--key-binding-keymap (key &optional accept-default no-remap position)
"Return a keymap holding a binding for KEY within current keymaps.
The effect of the arguments KEY, ACCEPT-DEFAULT, NO-REMAP and
POSITION is as documented in the function `key-binding'."
(let* ((active-maps (current-active-maps t position))
map found)
;; We loop over active maps like key-binding does.
(while (and
(not found)
(setq map (pop active-maps)))
(setq found (lookup-key map key accept-default))
(when (integerp found)
;; The first `found' characters of KEY were found but not the
;; whole sequence.
(setq found nil)))
(when found
(if (and (symbolp found)
(not no-remap)
(command-remapping found))
;; The user might want to know in which map the binding is
;; found, or in which map the remapping is found. The
;; default is to show the latter.
(help--key-binding-keymap (vector 'remap found))
map))))