]> git.eshelyaron.com Git - emacs.git/commitdiff
Warn about misplaced :success in condition-case (bug#64404)
authorMattias Engdegård <mattiase@acm.org>
Sun, 2 Jul 2023 09:44:29 +0000 (11:44 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 2 Jul 2023 09:53:36 +0000 (11:53 +0200)
* lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case):
Warn if :success is part of a list of conditions (it must come alone).

lisp/emacs-lisp/bytecomp.el

index 99202185d8d3c7ff24054144e925f9ac5eb4acb5..262c658e258a4f64d10b04f08f31efc8af670702 100644 (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))