Skip to content

Commit

Permalink
transient--parse-suffix: Catch additional mistakes near end of spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Oct 8, 2024
1 parent 92df5a4 commit bbda5bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)))
Expand Down

0 comments on commit bbda5bb

Please sign in to comment.