]> git.eshelyaron.com Git - emacs.git/commit
Use compiler macros for the key syntax checks
authorMattias Engdegård <mattiase@acm.org>
Sun, 28 Nov 2021 17:04:06 +0000 (18:04 +0100)
committerMattias Engdegård <mattiase@acm.org>
Sun, 28 Nov 2021 17:10:23 +0000 (18:10 +0100)
commitd50e0bdbac8e6683c6af4efa172c1b801d250486
treeef96e34d1b14453a2f7e83dc5014da883aef8cda
parent1e8074f5ea9e61a6fba33ab2af0c79b9af7d7a24
Use compiler macros for the key syntax checks

Compile-time key string syntax checks are better written using
compiler macros than with byte-hunk-handlers inside the compiler
proper.

* lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap)
(byte-compile-define-keymap--define): Remove.
* lisp/keymap.el (keymap--compile-check): New.
(keymap-set, keymap-global-set, keymap-local-set, keymap-global-unset)
(keymap-local-unset, keymap-unset, keymap-substitute)
(keymap-set-after, key-translate, keymap-lookup, keymap-local-lookup)
(keymap-global-lookup): Use compiler-macro for argument checks.
* lisp/subr.el (define-keymap--compile): New.
(define-keymap--define): Fold into define-keymap.
(define-keymap): Use compiler-macro.
(defvar-keymap): Use define-keymap.
lisp/emacs-lisp/bytecomp.el
lisp/keymap.el
lisp/subr.el