* 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.
(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))
(macroexpand form)
(should (string-empty-p messages))))))))
+(ert-deftest cl-&key-arguments ()
+ (cl-flet ((fn (&key x) x))
+ (should-error (fn :x))
+ (should (eq (fn :x :a) :a))))
+
+
;;; cl-macs-tests.el ends here