Fix &key parameters called without arguments (bug#58714)
* lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Check for missing argument. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments): New test.
This commit is contained in:
parent
c64d94c849
commit
6d9065b748
2 changed files with 8 additions and 0 deletions
|
@ -656,6 +656,8 @@ its argument list allows full Common Lisp conventions."
|
|||
(check `(while ,var
|
||||
(cond
|
||||
((memq (car ,var) ',(append keys allow))
|
||||
(unless (cdr ,var)
|
||||
(error "Missing argument for %s" (car ,var)))
|
||||
(setq ,var (cdr (cdr ,var))))
|
||||
((car (cdr (memq (quote ,@allow) ,restarg)))
|
||||
(setq ,var nil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue