From: Noam Postavsky Date: Wed, 7 Mar 2018 00:26:32 +0000 (-0500) Subject: Let warning about (:foo) be suppressible (Bug#30499) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=672b68cb2286e1d0c0e52d44f09745997da9b5e1;p=emacs.git 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. --- 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)