From bbda5bb67eee68cb75495dce1cc3fed28e94e0bc Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 8 Oct 2024 20:08:14 +0200 Subject: [PATCH] transient--parse-suffix: Catch additional mistakes near end of spec --- lisp/transient.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 0f984d1..95c6a94 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1234,8 +1234,8 @@ commands are aliases for." ((setq class 'transient-option))))) ((error "Need command, argument, `:info' or `:info*'; got %s" car))) (while (keywordp car) - (let ((key pop) - (val pop)) + (let* ((key pop) + (val (if spec pop (error "No value for `%s'" key)))) (cond ((eq key :class) (setq class val)) ((eq key :level) (setq level val)) ((eq key :info) @@ -1249,7 +1249,9 @@ commands are aliases for." ((or (symbolp val) (and (listp val) (not (eq (car val) 'lambda)))) (setq args (plist-put args key (macroexp-quote val)))) - ((setq args (plist-put args key val))))))) + ((setq args (plist-put args key val)))))) + (when spec + (error "Need keyword, got %S" car))) (when-let* (((not (plist-get args :key))) (shortarg (plist-get args :shortarg))) (setq args (plist-put args :key shortarg)))