Warn about misplaced :success in condition-case (bug#64404)

* lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case):
Warn if :success is part of a list of conditions (it must come alone).
This commit is contained in:
Mattias Engdegård 2023-07-02 11:44:29 +02:00
parent a2ccab18ca
commit 59a350cb91

View file

@ -5060,6 +5060,10 @@ binding slots have been popped."
(byte-compile-warn-x
condition "`condition-case' condition should not be quoted: %S"
condition))
(when (and (consp condition) (memq :success condition))
(byte-compile-warn-x
condition
"`:success' must be the first element of a `condition-case' handler"))
(unless (consp condition) (setq condition (list condition)))
(dolist (c condition)
(unless (and c (symbolp c))