Function: local-key-binding

local-key-binding is a byte-compiled function defined in subr.el.gz.

Signature

(local-key-binding KEYS &optional ACCEPT-DEFAULT)

Documentation

Return the binding for command KEYS in current local keymap only.

This is a legacy function; see keymap-local-lookup for the recommended function to use instead.

KEYS is a string or vector, a sequence of keystrokes. The binding is probably a symbol with a function definition.

If optional argument ACCEPT-DEFAULT is non-nil, recognize default bindings; see the description of lookup-key for more details about this.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun local-key-binding (keys &optional accept-default)
  "Return the binding for command KEYS in current local keymap only.
This is a legacy function; see `keymap-local-lookup' for the
recommended function to use instead.

KEYS is a string or vector, a sequence of keystrokes.
The binding is probably a symbol with a function definition.

If optional argument ACCEPT-DEFAULT is non-nil, recognize default
bindings; see the description of `lookup-key' for more details
about this."
  (let ((map (current-local-map)))
    (when map (lookup-key map keys accept-default))))