diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-07-02 11:44:29 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-07-02 11:53:36 +0200 |
commit | 59a350cb911a1c488635d1eb447b07a509939125 (patch) | |
tree | ecf035f21fff8951e204f143f0adcba7ce5fe094 | |
parent | a2ccab18ca247c5ba99499aa65470e15e33adcda (diff) | |
download | emacs-59a350cb911a1c488635d1eb447b07a509939125.tar.gz |
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).
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 4 |
1 files changed, 4 insertions, 0 deletions
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)) |