Function: keymap-local-unset

keymap-local-unset is an interactive and byte-compiled function defined in keymap.el.gz.

Signature

(keymap-local-unset KEY &optional REMOVE)

Documentation

Remove local binding of KEY (if any).

When called interactively, KEY is a key sequence. When called from Lisp, KEY is a string that satisfies key-valid-p.

If REMOVE is non-nil (interactively, the prefix arg), remove the binding instead of unsetting it. See keymap-unset for details.

Other relevant functions are documented in the keymaps group.

View in manual

Probably introduced at or before Emacs version 29.1.

Key Bindings

Shortdoc

;; keymaps
(keymap-local-unset "C-c C-c")

Source Code

;; Defined in /usr/src/emacs/lisp/keymap.el.gz
(defun keymap-local-unset (key &optional remove)
  "Remove local binding of KEY (if any).
When called interactively, KEY is a key sequence.  When called from
Lisp, KEY is a string that satisfies `key-valid-p'.

If REMOVE is non-nil (interactively, the prefix arg), remove the
binding instead of unsetting it.  See `keymap-unset' for details."
  (declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
  (interactive
   (list (key-description (read-key-sequence "Unset key locally: "))
         current-prefix-arg))
  (when (current-local-map)
    (keymap-unset (current-local-map) key remove)))