mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-24 19:03:29 +00:00
Error out on invalid `define-keymap' keywords
* lisp/subr.el (define-keymap--define): Error out on invalid keywords (bug#51268). * lisp/emacs-lisp/byte-opt.el (byte-optimize-define-keymap): Check keywords at compile time. * lisp/vc/cvs-status.el (cvs-status-mode-map): Fix keyword.
This commit is contained in:
parent
fbf7dd3cce
commit
5c996471ba
@ -1211,6 +1211,9 @@ See Info node `(elisp) Integer Basics'."
|
|||||||
(while (and form
|
(while (and form
|
||||||
(keywordp (car form))
|
(keywordp (car form))
|
||||||
(not (eq (car form) :menu)))
|
(not (eq (car form) :menu)))
|
||||||
|
(unless (memq (car form)
|
||||||
|
'(:full :keymap :parent :suppress :name :prefix))
|
||||||
|
(error "Invalid keyword: %s" (car form)))
|
||||||
(push (pop form) result)
|
(push (pop form) result)
|
||||||
(when (null form)
|
(when (null form)
|
||||||
(error "Uneven number of keywords in %S" form))
|
(error "Uneven number of keywords in %S" form))
|
||||||
|
@ -6664,7 +6664,8 @@ should be a MENU form as accepted by `easy-menu-define'.
|
|||||||
(:parent (setq parent value))
|
(:parent (setq parent value))
|
||||||
(:suppress (setq suppress value))
|
(:suppress (setq suppress value))
|
||||||
(:name (setq name value))
|
(:name (setq name value))
|
||||||
(:prefix (setq prefix value))))))
|
(:prefix (setq prefix value))
|
||||||
|
(_ (error "Invalid keyword: %s" keyword))))))
|
||||||
|
|
||||||
(when (and prefix
|
(when (and prefix
|
||||||
(or full parent suppress keymap))
|
(or full parent suppress keymap))
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
;;;
|
;;;
|
||||||
|
|
||||||
(defvar-keymap cvs-status-mode-map
|
(defvar-keymap cvs-status-mode-map
|
||||||
:inherit 'cvs-mode-map
|
:parent 'cvs-mode-map
|
||||||
"n" #'next-line
|
"n" #'next-line
|
||||||
"p" #'previous-line
|
"p" #'previous-line
|
||||||
"N" #'cvs-status-next
|
"N" #'cvs-status-next
|
||||||
|
Loading…
Reference in New Issue
Block a user