From e18a509f713b5d8c395e7896b45f76753407d0cb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 5 May 2024 00:05:23 -0400 Subject: [PATCH] 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. --- lisp/doom.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/doom.el b/lisp/doom.el index 70873316d..81f09466e 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -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)))