Emacs Keys: Keybinding Functions, Emacs 29 Change

By Xah Lee. Date: . Last updated: .

Emacs 29 keybinding function change

Emacs 29 (date 2023) added many new functions for keybinding.

emacs 29emacs 28
keymap-setdefine-key
keymap-global-setglobal-set-key
keymap-local-setlocal-set-key
keymap-global-unsetglobal-unset-key
keymap-local-unsetlocal-unset-key
keymap-substitutesubstitute-key-definition
keymap-set-afterdefine-key-after
keymap-lookuplookup-key and key-binding
keymap-local-lookuplocal-key-binding
keymap-global-lookupglobal-key-binding

new functions for creating keymaps:

〔see Elisp: Create Keymap (keybinding)

Example

;; example

;; emacs 29 syntax
(keymap-global-set "C-t" #'whitespace-mode)

;; emacs 28 or before
(global-set-key (kbd "C-t") #'whitespace-mode)

Emacs, Change Keys