From e0c7b6e31e8c03dd66a929742898f2d6e2628356 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Apr 2025 16:35:49 +0300 Subject: [PATCH] Fix warning messages about lexbind cookie in subdirs.el * lisp/files.el (internal--get-default-lexical-binding): Don't log a warning message when lexbind warning is disabled, and 'display-warning' is unavailable or signals an error. --- lisp/files.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index ad6047bd02d..4fb1221ec0d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4314,7 +4314,10 @@ for more information." ;; fail (e.g. not yet defined, or can't be (auto)loaded), ;; so use a simple fallback that won't get in the way. (error - (message "Missing `lexical-binding' cookie in %S" source))))) + ;; But not if this particular warning is disabled. + (unless (equal warning-inhibit-types + '((files missing-lexbind-cookie))) + (message "Missing `lexical-binding' cookie in %S" source)))))) (default-toplevel-value 'lexical-binding))) (setq internal--get-default-lexical-binding-function