From 2bc6dd2a96fca93202404726a2c24c67418fcf8b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 1 Sep 2024 12:55:04 -0400 Subject: [PATCH] fix(cli): don't load subdirs.el again Doom loaded subdirs.el's in `load-path`, but doesn't need to. This normally wasn't an issue because subdirs.el files are typically idempotent, but there is one case where it isn't: on nixpkgs, with certain configurations on top of programs.emacs (see NixOS/nixpkgs#267548), which will cause file-missing errors trying to load the user's site-lisp afterwards (see #7681). Ref: NixOS/nixpkgs#267548 Fix: #7681 Amend: 6c0b7e1530a6 --- lisp/doom-cli.el | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index 666551311..43d8a46ff 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -30,20 +30,9 @@ ;; information to the user, like deprecation notices, file-loaded messages, ;; and linter warnings. With this, that output is suppressed. (quiet! - (require 'cl nil t) - (unless site-run-file - (let ((site-run-file "site-start") - (tail load-path) - (lispdir (expand-file-name "../lisp" data-directory)) - dir) - (while tail - (setq dir (car tail)) - (let ((default-directory dir)) - (load (expand-file-name "subdirs.el") t inhibit-message t)) - (unless (string-prefix-p lispdir dir) - (let ((default-directory dir)) - (load (expand-file-name "leim-list.el") t inhibit-message t))) - (setq tail (cdr tail))) + (require 'cl nil t) ; "Package cl is deprecated" + (unless site-run-file ; unset in doom.el + (when-let ((site-run-file (get 'site-run-file 'initial-value))) (load site-run-file t inhibit-message)))) (setq-default