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.
This commit is contained in:
Eli Zaretskii 2025-04-13 16:35:49 +03:00
parent ebaf424126
commit e0c7b6e31e

View file

@ -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