Emacs Keys: new keybinding functions (emacs 29. 2023)

By Xah Lee. Date: . Last updated: .

Emacs 29 keybinding function change

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

emacs 29emacs 28
defvar-keymapnone
define-keymapnone
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

[see Elisp: Create Keymap (keybinding)]

Example

;; syntax for emacs 29 or later
(keymap-global-set "C-t" #'backward-char)

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

Emacs, Change Keys