summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-03-06 19:26:32 -0500
committerNoam Postavsky <npostavs@gmail.com>2018-03-10 19:51:28 -0500
commit864643929b7e241020c3a43b830d6ccf1c1726d8 (patch)
tree779b02cfa96563b7fcafc339982351f7717452d5 /lisp/emacs-lisp/bytecomp.el
parentfda58fbc245a3f6f6722261ffb2e2262231bd4ea (diff)
downloademacs-864643929b7e241020c3a43b830d6ccf1c1726d8.tar.gz
emacs-864643929b7e241020c3a43b830d6ccf1c1726d8.tar.bz2
emacs-864643929b7e241020c3a43b830d6ccf1c1726d8.zip
Let warning about (:foo) be suppressible (Bug#30499)
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Check byte-compile-warning-enabled-p before warning about funcalling const symbol.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 1bf6d04b63b..2a986f6cbbc 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3119,7 +3119,8 @@ for symbols generated by the byte compiler itself."
(when (assq var byte-compile-lexical-variables)
(byte-compile-report-error
(format-message "%s cannot use lexical var `%s'" fn var))))))
- (when (macroexp--const-symbol-p fn)
+ (when (and (byte-compile-warning-enabled-p 'suspicious)
+ (macroexp--const-symbol-p fn))
(byte-compile-warn "`%s' called as a function" fn))
(when (and (byte-compile-warning-enabled-p 'interactive-only)
interactive-only)