[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 59a350cb911: Warn about misplaced :success in condition-case (bug
From: |
Mattias Engdegård |
Subject: |
master 59a350cb911: Warn about misplaced :success in condition-case (bug#64404) |
Date: |
Sun, 2 Jul 2023 05:53:53 -0400 (EDT) |
branch: master
commit 59a350cb911a1c488635d1eb447b07a509939125
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
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).
---
lisp/emacs-lisp/bytecomp.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 99202185d8d..262c658e258 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 59a350cb911: Warn about misplaced :success in condition-case (bug#64404),
Mattias Engdegård <=