diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-10-03 11:04:16 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-10-03 11:04:16 +0200 |
commit | 450d94920f5abc36167beb02be909ff65a7f4111 (patch) | |
tree | 97c56fb2331f619098a89330363cdbba76d657f7 /lisp/keymap.el | |
parent | 2973f91fb3de824cd21399dc5cd298d4b8be4022 (diff) | |
download | emacs-450d94920f5abc36167beb02be909ff65a7f4111.tar.gz emacs-450d94920f5abc36167beb02be909ff65a7f4111.tar.bz2 emacs-450d94920f5abc36167beb02be909ff65a7f4111.zip |
Revert "keymap.el: Ease up support for non-`kbd` formats."
This reverts commit 570a11052be6178954956a1c59c8ebcbdb77d38e.
We do not want to support several keymap formats in
`keymap-set' and friends -- the point is to have an
interface with easy-to-understand semantics that
give good feedback on valid/invalid key sequences.
Diffstat (limited to 'lisp/keymap.el')
-rw-r--r-- | lisp/keymap.el | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lisp/keymap.el b/lisp/keymap.el index c46e72f0a89..107565590c1 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -39,8 +39,7 @@ (defun keymap-set (keymap key definition) "Set KEY to DEFINITION in KEYMAP. -KEY is a string that satisfies `key-valid-p' (or a vector using the -internal representation of key sequences). +KEY is a string that satisfies `key-valid-p'. DEFINITION is anything that can be a key's definition: nil (means key is undefined in this keymap), @@ -58,13 +57,13 @@ DEFINITION is anything that can be a key's definition: or an extended menu item definition. (See info node `(elisp)Extended Menu Items'.)" (declare (compiler-macro (lambda (form) (keymap--compile-check key) form))) - (unless (vectorp key) (keymap--check key)) + (keymap--check key) ;; If we're binding this key to another key, then parse that other ;; key, too. (when (stringp definition) (keymap--check definition) (setq definition (key-parse definition))) - (define-key keymap (if (vectorp key) key (key-parse key)) definition)) + (define-key keymap (key-parse key) definition)) (defun keymap-global-set (key command) "Give KEY a global binding as COMMAND. @@ -284,18 +283,6 @@ See `kbd' for a descripion of KEYS." (setq res (vconcat res key)))))) res))) -(defun key-parse-old-format (keys) - "Convert old-style string representation of KEYS to a vector. -Simpler alternative to the Rube-Goldbergesque composition of -`key-description' and `key-parse'." - (cond - ((vectorp keys) keys) - ((multibyte-string-p keys) (vconcat keys)) - ((stringp keys) - (vconcat (mapcar (lambda (c) (if (> c 127) (logior (- c 128) ?\M-\0) c)) - keys))) - (t (error "Invalid old-style key sequence: %S" keys)))) - (defun key-valid-p (keys) "Say whether KEYS is a valid key. A key is a string consisting of one or more key strokes. |