]> git.eshelyaron.com Git - emacs.git/commitdiff
Document `keymap-unset' in lispref
authorRobert Pluim <rpluim@gmail.com>
Fri, 17 Mar 2023 13:16:00 +0000 (14:16 +0100)
committerRobert Pluim <rpluim@gmail.com>
Fri, 17 Mar 2023 13:18:10 +0000 (14:18 +0100)
* doc/lispref/keymaps.texi (Changing Key Bindings): Document
keymap-unset.

doc/lispref/keymaps.texi

index 7876780dcd4952c2a1ab1bfe5148dfb0c7aa2f34..02feda5cd04c041b16ba234d0f0abbc3c31cdbde 100644 (file)
@@ -1427,6 +1427,17 @@ If @var{key} is @kbd{<t>}, this sets the default binding in
 @var{keymap}.  When an event has no binding of its own, the Emacs
 command loop uses the keymap's default binding, if there is one.
 
+@findex keymap-unset
+@defun keymap-unset keymap key &optional remove
+This function is the inverse of @code{keymap-set}, it unsets the
+binding for @var{key} in @var{keymap}, which is the same as setting
+the binding to @code{nil}.  In order to instead remove the binding
+completely, specify @var{remove} as non-nil.  This only makes a
+difference if @var{keymap} has 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.
+
 @cindex invalid prefix key error
 @cindex key sequence error
 Every prefix of @var{key} must be a prefix key (i.e., bound to a keymap)