1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
Lars Ingebrigtsen
cde5dcd441 Change the call signature to keymap-substitute
* lisp/keymap.el (keymap-substitute): Make the keymap the first
parameter for symmetry with the other functions.
* lisp/emacs-lisp/shortdoc.el (keymaps):
* lisp/emacs-lisp/bytecomp.el (lambda): Adjust.
2021-11-17 08:34:35 +01:00
Lars Ingebrigtsen
97c23204b9 Make keymap-unset work
* lisp/keymap.el (keymap-unset): Fix key syntax (bug#51897).
2021-11-16 19:42:09 +01:00
Lars Ingebrigtsen
de477ec683 Add new 'keymap-*' functions
* lisp/keymap.el: New file with all the new keymap-* functions.

* lisp/loadup.el ("keymap"): Load.

* lisp/subr.el (kbd): Refactor out all the code to key-parse.
(define-key-after, keyboard-translate, global-set-key)
(local-set-key, global-unset-key, local-unset-key)
(local-key-binding, global-key-binding)
(substitute-key-definition): Note in doc strings that these are
legacy functions.
(define-keymap--define): Use keymap-set.

* lisp/emacs-lisp/byte-opt.el: Remove the optimizations for
defvar-keymap and define-keymap since the macros now only
understand the kbd syntax.
* lisp/emacs-lisp/bytecomp.el (byte-compile-define-keymap)
(byte-compile-define-keymap--define): Warn about invalid key
definitions in all keymap-* functions.

* lisp/emacs-lisp/shortdoc.el (keymaps): Add shortdocs form
keymap* functions.

* src/keymap.c (possibly_translate_key_sequence): Adjust callers
to key-valid-p and key-parse.
(syms_of_keymap): Adjust defs.
2021-11-16 08:26:24 +01:00