From 864643929b7e241020c3a43b830d6ccf1c1726d8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 6 Mar 2018 19:26:32 -0500 Subject: [PATCH] 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. --- lisp/emacs-lisp/bytecomp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.11.4.GIT