Function: keymap-local-set

keymap-local-set is a byte-compiled function defined in compat-29.el.

Signature

(keymap-local-set KEY COMMAND)

Documentation

[Compatibility function for keymap-local-set, defined in Emacs 29.1. See
(compat) Emacs 29.1' for more details.]

Give KEY a local binding as COMMAND. COMMAND is the command definition to use; usually it is a symbol naming an interactively-callable function.

KEY is a string that satisfies key-valid-p.

The binding goes in the current buffer's local map, which in most cases is shared with all other buffers in the same major mode.

NOTE: The compatibility version is not a command.

Source Code

;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-29.el
(compat-defun keymap-local-set (key command) ;; <compat-tests:keymap-local-set>
  "Give KEY a local binding as COMMAND.
COMMAND is the command definition to use; usually it is
a symbol naming an interactively-callable function.

KEY is a string that satisfies `key-valid-p'.

The binding goes in the current buffer's local map, which in most
cases is shared with all other buffers in the same major mode.

NOTE: The compatibility version is not a command."
  (let ((map (current-local-map)))
    (unless map
      (use-local-map (setq map (make-sparse-keymap))))
    (keymap-set map key command)))