summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2022-09-19 13:34:51 +0200
committerPhilipp Stephani <phst@google.com>2022-09-19 13:34:51 +0200
commita71de4b52d3de14349ded7d88c4cae6e2a9376ae (patch)
tree9fa8895e0b37a59a8977112c03fa9ff594ec45c5 /lisp/emacs-lisp
parentf735aa0f3954750df799fce3452b56e5bdac2184 (diff)
downloademacs-a71de4b52d3de14349ded7d88c4cae6e2a9376ae.tar.gz
emacs-a71de4b52d3de14349ded7d88c4cae6e2a9376ae.tar.bz2
emacs-a71de4b52d3de14349ded7d88c4cae6e2a9376ae.zip
Improve check for misleading 'cl-case' cases (Bug#57915).
* lisp/emacs-lisp/cl-macs.el (cl-case): Check that the case is of the form (quote FOO), not just (quote). * test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-no-warning): New unit test.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 5d330f32d66..beafee1d631 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -792,7 +792,7 @@ compared by `eql'.
(macroexp-warn-and-return
"Case nil will never match"
nil 'suspicious))
- ((and (consp (car c)) (not (cddar c))
+ ((and (consp (car c)) (cdar c) (not (cddar c))
(memq (caar c) '(quote function)))
(macroexp-warn-and-return
(format-message