Function: keymap-unset

keymap-unset is a byte-compiled function defined in keymap.el.gz.

Signature

(keymap-unset KEYMAP KEY &optional REMOVE)

Documentation

Remove key sequence KEY from KEYMAP.

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

If REMOVE is non-nil, remove the binding instead of unsetting it. This only makes a difference when there's a parent keymap. When unsetting a key in a child map, it will still shadow the same key in the parent keymap. Removing the binding will allow the key in the parent keymap to be used.

Other relevant functions are documented in the keymaps group.

View in manual

Shortdoc

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

Source Code

;; Defined in /usr/src/emacs/lisp/keymap.el.gz
(defun keymap-unset (keymap key &optional remove)
  "Remove key sequence KEY from KEYMAP.
KEY is a string that satisfies `key-valid-p'.

If REMOVE is non-nil, remove the binding instead of unsetting it.
This only makes a difference when there's a parent keymap.  When
unsetting a key in a child map, it will still shadow the same key
in the parent keymap.  Removing the binding will allow the key in
the parent keymap to be used."
  (declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
  (keymap--check key)
  (define-key keymap (key-parse key) nil remove))