diff --git a/bin/doom b/bin/doom index ba47677db..fdd47ea04 100755 --- a/bin/doom +++ b/bin/doom @@ -9,7 +9,7 @@ :; export __DOOMGEOM="${__DOOMGEOM:-`tput cols 2>/dev/null`x`tput lines 2>/dev/null`}" :; export __DOOMGPIPE=${__DOOMGPIPE:-$__DOOMPIPE} :; export __DOOMPIPE=; [ -t 0 ] || __DOOMPIPE="${__DOOMPIPE}0"; [ -t 1 ] || __DOOMPIPE="${__DOOMPIPE}1" -:; $emacs --load "$0" -- "$@" || exit=$? +:; $emacs --eval "(setq warning-inhibit-types '((files missing-lexbind-cookie)))" --load "$0" -- "$@" || exit=$? :; [ "${exit:-0}" -eq 254 ] && { export TMPDIR="${TMPDIR:-${TMP:-${TEMP:-`$emacs -Q --eval '(princ temporary-file-directory)' 2>/dev/null`}}}"; sh "${TMPDIR}/doom.${__DOOMPID}.${__DOOMSTEP}.sh" "$0" "$@" && true; exit="$?"; } :; exit $exit diff --git a/bin/doomscript b/bin/doomscript index 9babc3030..0afd2e3d9 100755 --- a/bin/doomscript +++ b/bin/doomscript @@ -38,7 +38,7 @@ esac # directory from `load-path', which would prevent Doom from manually loading the # site files later. These are important on some systems or deployment methods # (like Snap or NixOS). -emacs="$EMACS -q --no-site-file --batch" +emacs="$EMACS -q --no-site-file --batch --eval \"(setq warning-inhibit-types '((files missing-lexbind-cookie)))\"" # Doom respects $EMACSDIR to tell it where Doom lives. If it fails, then this is # either isn't bash, or it's a posix shell being directly sourced with sh, which diff --git a/lisp/doom.el b/lisp/doom.el index ca3c3b945..ec29cbe8a 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -665,6 +665,12 @@ to `doom-profile-cache-dir' instead, so it can be safely cleaned up as part of ;; still aliases them fine regardless. (setq warning-suppress-types '((defvaralias) (lexical-binding))) +;; As some point in 31+, Emacs began spamming the user with warnings about +;; missing `lexical-binding' cookies in elisp files that you are unlikely to +;; have any direct control over (e.g. package files, data lisp files, and elisp +;; shell scripts). This shuts it up. +(setq warning-inhibit-types '((files missing-lexbind-cookie))) + ;; Reduce debug output unless we've asked for it. (setq debug-on-error init-file-debug jka-compr-verbose init-file-debug) @@ -880,12 +886,6 @@ appropriately against `noninteractive' or the `cli' context." ;; the session is complicated by user config and packages. (doom-run-hooks 'doom-before-init-hook) - ;; 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. - (cl-callf2 assq-delete-all 'lexical-binding delayed-warnings-list) - ;; HACK: Ensure OS checks are as fast as possible (given their ubiquity). (setq features (cons :system (delq :system features)))