Don't abbreviate autoload paths on windows #1548

This commit is contained in:
Henrik Lissner 2019-07-10 16:05:40 +02:00
parent dfa5324f3d
commit cb401c8302
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -241,6 +241,7 @@ modules/*/*/autoload.el and modules/*/*/autoload/*.el, and generates
Run this whenever your `doom!' block, or a module autoload file, is modified." Run this whenever your `doom!' block, or a module autoload file, is modified."
(let* ((default-directory doom-emacs-dir) (let* ((default-directory doom-emacs-dir)
(doom-modules (doom-modules)) (doom-modules (doom-modules))
(abbreviated-home-dir (if IS-WINDOWS "\\`'" abbreviated-home-dir))
(targets (targets
(file-expand-wildcards (file-expand-wildcards
(expand-file-name "autoload/*.el" doom-core-dir))) (expand-file-name "autoload/*.el" doom-core-dir)))
@ -350,33 +351,34 @@ Will do nothing if none of your installed packages have been modified. If
FORCE-P (universal argument) is non-nil, regenerate it anyway. FORCE-P (universal argument) is non-nil, regenerate it anyway.
This should be run whenever your `doom!' block or update your packages." This should be run whenever your `doom!' block or update your packages."
(if (and (not force-p) (let ((abbreviated-home-dir (if IS-WINDOWS "\\`'" abbreviated-home-dir)))
(not doom-emacs-changed-p) (if (and (not force-p)
(file-exists-p doom-package-autoload-file) (not doom-emacs-changed-p)
(not (file-newer-than-file-p doom-packages-dir doom-package-autoload-file)) (file-exists-p doom-package-autoload-file)
(not (ignore-errors (not (file-newer-than-file-p doom-packages-dir doom-package-autoload-file))
(cl-loop for key being the hash-keys of (doom-modules) (not (ignore-errors
for path = (doom-module-path (car key) (cdr key) "packages.el") (cl-loop for key being the hash-keys of (doom-modules)
if (file-newer-than-file-p path doom-package-autoload-file) for path = (doom-module-path (car key) (cdr key) "packages.el")
return t)))) if (file-newer-than-file-p path doom-package-autoload-file)
(ignore (print! (green "Doom package autoloads is up-to-date")) return t))))
(doom-initialize-autoloads doom-package-autoload-file)) (ignore (print! (green "Doom package autoloads is up-to-date"))
(let (case-fold-search) (doom-initialize-autoloads doom-package-autoload-file))
(doom-delete-autoloads-file doom-package-autoload-file) (let (case-fold-search)
(with-temp-file doom-package-autoload-file (doom-delete-autoloads-file doom-package-autoload-file)
(doom--generate-header 'doom-reload-package-autoloads) (with-temp-file doom-package-autoload-file
(save-excursion (doom--generate-header 'doom-reload-package-autoloads)
;; Cache important and expensive-to-initialize state here. (save-excursion
(doom--generate-var-cache) ;; Cache important and expensive-to-initialize state here.
(print! (green "✓ Cached package state")) (doom--generate-var-cache)
;; Concatenate the autoloads of all installed packages. (print! (green "✓ Cached package state"))
(doom--generate-package-autoloads) ;; Concatenate the autoloads of all installed packages.
(print! (green "✓ Package autoloads included"))) (doom--generate-package-autoloads)
;; Remove `load-path' and `auto-mode-alist' modifications (most of them, (print! (green "✓ Package autoloads included")))
;; at least); they are cached later, so all those membership checks are ;; Remove `load-path' and `auto-mode-alist' modifications (most of them,
;; unnecessary overhead. ;; at least); they are cached later, so all those membership checks are
(doom--cleanup-package-autoloads) ;; unnecessary overhead.
(print! (green "✓ Removed load-path/auto-mode-alist entries")))) (doom--cleanup-package-autoloads)
(doom--byte-compile-file doom-package-autoload-file) (print! (green "✓ Removed load-path/auto-mode-alist entries"))))
(doom--reload-files doom-package-autoload-file) (doom--byte-compile-file doom-package-autoload-file)
t)) (doom--reload-files doom-package-autoload-file)
t)))