1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

Warn about ignore-error with quoted condition argument

* lisp/subr.el (ignore-error):
Clarify condition argument in doc string and add warning.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-warn-quoted-condition): New test.
This commit is contained in:
Mattias Engdegård 2022-12-28 14:40:19 +01:00
parent a6db8464e1
commit 1480865e64
2 changed files with 16 additions and 2 deletions

View file

@ -922,6 +922,11 @@ byte-compiled. Run with dynamic binding."
(bytecomp--with-warning-test "defvar.*foo.*wider than.*characters"
`(defvar foo t ,bytecomp-tests--docstring)))
(ert-deftest bytecomp-warn-quoted-condition ()
(bytecomp--with-warning-test
"Warning: `ignore-error' condition argument should not be quoted: 'error"
'(ignore-error 'error (abc))))
(ert-deftest bytecomp-warn-dodgy-args-eq ()
(dolist (fn '(eq eql))
(cl-flet ((msg (type arg)