aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-05-11 12:51:11 +0200
committerLars Ingebrigtsen2022-05-11 12:51:11 +0200
commit231cf5ee2bed8a2b574ad424b624b36c0ee0733f (patch)
tree33fc90e66dbec5f0a990b14d27c35c6bb9946a93 /test
parent5a121485037a21d03449bc955476c253c89e3671 (diff)
downloademacs-231cf5ee2bed8a2b574ad424b624b36c0ee0733f.tar.gz
emacs-231cf5ee2bed8a2b574ad424b624b36c0ee0733f.zip
Warn about quoted symbols in defcustom choice/other forms
* lisp/emacs-lisp/bytecomp.el (byte-compile--suspicious-defcustom-choice): New function (bug#16271). (byte-compile-nogroup-warn): Use it to warn about forms like (choice (const :tag "foo" 'bar)).
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index abd33ab8e5a..051e8b9e5c9 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -1538,6 +1538,12 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \
1538(TEST-IN-COMMENTS t) (TEST-IN-STRINGS t) (TEST-IN-CODE t) \ 1538(TEST-IN-COMMENTS t) (TEST-IN-STRINGS t) (TEST-IN-CODE t) \
1539(FIXTURE-FN \\='#\\='electric-pair-mode))" fill-column))) 1539(FIXTURE-FN \\='#\\='electric-pair-mode))" fill-column)))
1540 1540
1541(defun test-bytecomp-defgroup-choice ()
1542 (should-not (byte-compile--suspicious-defcustom-choice 'integer))
1543 (should-not (byte-compile--suspicious-defcustom-choice
1544 '(choice (const :tag "foo" bar))))
1545 (should (byte-compile--suspicious-defcustom-choice
1546 '(choice (const :tag "foo" 'bar)))))
1541 1547
1542;; Local Variables: 1548;; Local Variables:
1543;; no-byte-compile: t 1549;; no-byte-compile: t