Emacs Keys: Keybinding Functions (emacs 29 and emacs 28)

By Xah Lee. Date: . Last updated: .

Emacs 29 keybinding function change

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

The old functions are still supported.

Their syntax is pretty much the same.

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
;; example

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

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

Other Keybinding Functions Change

Emacs, Change Keys