Function: keymap-global-unset

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

Signature

(keymap-global-unset KEY &optional REMOVE)

Documentation

Remove global 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-global-unset "C-c C-c")

Source Code

;; Defined in /usr/src/emacs/lisp/keymap.el.gz
(defun keymap-global-unset (key &optional remove)
  "Remove global 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 globally: "))
         current-prefix-arg))
  (keymap-unset (current-global-map) key remove))