fix: suppress lexical-binding warnings on 30+

These checks and warnings were added on some recent commit of Emacs.
They're annoying to deal with and the end-user typically can't do much
about them (e.g. old packages), so I suppress them across the board.

That said, there are a few we cannot catch in non-interactive
sessions (where they aren't delayed), and those early warnings don't
respect delayed-warnings-list. This ought to be considered a bug
upstream.
This commit is contained in:
Henrik Lissner 2024-05-05 00:05:23 -04:00
parent 587f237e93
commit e18a509f71
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -686,7 +686,7 @@ of 'doom sync' or 'doom gc'."
;; defvaralias, which are done because ensuring aliases are created before
;; packages are loaded is an unneeded and unhelpful maintenance burden. Emacs
;; still aliases them fine regardless.
(setq warning-suppress-types '((defvaralias)))
(setq warning-suppress-types '((defvaralias) (lexical-binding)))
;; Reduce debug output unless we've asked for it.
(setq debug-on-error init-file-debug
@ -763,6 +763,12 @@ appropriately against `noninteractive' or the `cli' context."
(add-hook! 'doom-before-init-hook :depth -105
(defun doom--begin-init-h ()
"Begin the startup process."
;; HACK: Later versions of Emacs 30 emit warnings about missing
;; lexical-bindings directives at the top of loaded files. This is a good
;; thing, but it inundates users with unactionable warnings (from old
;; packages or internal subdirs.el files), which aren't useful.
(setq-default delayed-warnings-list
(assq-delete-all 'lexical-binding delayed-warnings-list))
(when (doom-context-push 'init)
;; HACK: Ensure OS checks are as fast as possible (given their ubiquity).
(setq features (cons :system (delq :system features)))