From a9fdeefe15737e25951bc5922704a7d0340991d3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 14 Sep 2018 09:35:00 -0400 Subject: [PATCH] Revert 142d364 Only add doom-private-dir to load-path during autoload generation, otherwise a $DOOMDIR/autoload.el will shadow the built-in autoload.el Emacs package. Note: with `doom-private-dir' in `load-path', Doom autoloads files will be unable to declare autoloads for the built-in autoload.el Emacs package, should $DOOMDIR/autoload.el exist. Not sure why they'd want to though, so it's an acceptable compromise for simpler autoload declarations. --- core/cli/autoloads.el | 9 ++++++++- core/core.el | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index e964bc5ae..33150e75f 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -121,7 +121,14 @@ even if it doesn't need reloading!" (abbreviate-file-name file)))))) (defun doom--expand-autoloads () - (let ((load-path (append doom-modules-dirs load-path)) + (let ((load-path + ;; NOTE With `doom-private-dir' in `load-path', Doom autoloads files + ;; will be unable to declare autoloads for the built-in autoload.el + ;; Emacs package, should $DOOMDIR/autoload.el exist. Not sure why + ;; they'd want to though, so it's an acceptable compromise. + (append (list doom-private-dir) + doom-modules-dirs + load-path)) cache) (while (re-search-forward "^\\s-*(autoload\\s-+'[^ ]+\\s-+\"\\([^\"]*\\)\"" nil t) (let ((path (match-string 1))) diff --git a/core/core.el b/core/core.el index b927c6dd1..91531e739 100644 --- a/core/core.el +++ b/core/core.el @@ -466,8 +466,6 @@ in interactive sessions, nil otherwise (but logs a warning)." (unless noninteractive (doom-initialize-modules)) -(add-to-list 'load-path doom-private-dir) - (after! package (require 'core-packages))