cond*: Fix handling of :non-exit keywords

* lisp/emacs-lisp/cond-star.el (cond*-non-exit-clause-p): Don't
return nil for clauses ending with ':non-exit'.
(cond*-non-exit-clause-substance): Don't accept just any
keyword, require ':non-exit'.
This commit is contained in:
Sean Whitton 2026-02-08 15:28:37 +00:00
parent ec8d82f53b
commit 01d8abea04

View file

@ -199,7 +199,9 @@ CONDITION of a `cond*' clause. See `cond*' for details."
(or (eq (car clause) t)
;; Starts with a `bind*' or `bind-and*' pseudo-form.
(and (consp (car clause))
(memq (caar clause) '(bind* bind-and*)))))))
(memq (caar clause) '(bind* bind-and*)))))
;; Ends with keyword.
(eq (car (last clause)) :non-exit)))
(defun cond*-non-exit-clause-substance (clause)
"For a non-exit cond* clause CLAUSE, return its substance.
@ -218,7 +220,7 @@ This removes a final keyword if that's what makes CLAUSE non-exit."
(cons t (cdr clause)))
;; Ends with keyword.
((keywordp (car (last clause)))
((eq (car (last clause)) :non-exit)
;; Do NOT include the final keyword.
(butlast clause))))