summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-11 12:51:11 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-11 12:51:11 +0200
commit231cf5ee2bed8a2b574ad424b624b36c0ee0733f (patch)
tree33fc90e66dbec5f0a990b14d27c35c6bb9946a93 /test/lisp/emacs-lisp
parent5a121485037a21d03449bc955476c253c89e3671 (diff)
downloademacs-231cf5ee2bed8a2b574ad424b624b36c0ee0733f.tar.gz
emacs-231cf5ee2bed8a2b574ad424b624b36c0ee0733f.tar.bz2
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/lisp/emacs-lisp')
-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)) \
(TEST-IN-COMMENTS t) (TEST-IN-STRINGS t) (TEST-IN-CODE t) \
(FIXTURE-FN \\='#\\='electric-pair-mode))" fill-column)))
+(defun test-bytecomp-defgroup-choice ()
+ (should-not (byte-compile--suspicious-defcustom-choice 'integer))
+ (should-not (byte-compile--suspicious-defcustom-choice
+ '(choice (const :tag "foo" bar))))
+ (should (byte-compile--suspicious-defcustom-choice
+ '(choice (const :tag "foo" 'bar)))))
;; Local Variables:
;; no-byte-compile: t