mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-05 12:37:33 -05:00
Rewrite doom-reload + load-path bootstrap code
This commit is contained in:
@ -307,17 +307,36 @@ Examples:
|
|||||||
;; Global Defuns
|
;; Global Defuns
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defsubst --subdirs (path &optional include-self)
|
||||||
|
"Get list of subdirectories in PATH, including PATH is INCLUDE-SELF is
|
||||||
|
non-nil."
|
||||||
|
(let ((result (if include-self (list path) (list))))
|
||||||
|
(mapc (lambda (file)
|
||||||
|
(when (file-directory-p file)
|
||||||
|
(push file result)))
|
||||||
|
(ignore-errors (directory-files path t "^[^.]" t)))
|
||||||
|
result))
|
||||||
|
|
||||||
(defun doom-reload ()
|
(defun doom-reload ()
|
||||||
"Reload `load-path', in case you updated cask while emacs was open!"
|
"Reload `load-path' and `custom-theme-load-path', in case you updated cask
|
||||||
|
while emacs was open!"
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq load-path (append (list doom-private-dir doom-core-dir doom-modules-dir doom-packages-dir)
|
(let ((-load-path
|
||||||
(f-directories doom-core-dir nil t)
|
(append (list doom-private-dir doom-core-dir doom-modules-dir doom-packages-dir)
|
||||||
(f-directories doom-modules-dir nil t)
|
(--subdirs doom-core-dir t)
|
||||||
(f-directories doom-packages-dir)
|
(--subdirs doom-modules-dir t)
|
||||||
(f-directories (f-expand "../bootstrap" doom-packages-dir))
|
(--subdirs doom-packages-dir)
|
||||||
(f-directories doom-themes-dir nil t)
|
(--subdirs (expand-file-name (format "../../%s/bootstrap" emacs-version)
|
||||||
doom--load-path))
|
doom-packages-dir))
|
||||||
(message "Reloaded!"))
|
doom--load-path))
|
||||||
|
(-custom-theme-load-path
|
||||||
|
(append (--subdirs doom-themes-dir t)
|
||||||
|
custom-theme-load-path)))
|
||||||
|
(setq load-path -load-path
|
||||||
|
custom-theme-load-path -custom-theme-load-path)
|
||||||
|
(if (called-interactively-p 'interactive)
|
||||||
|
(message "Reloaded!")
|
||||||
|
(list -load-path -custom-theme-load-path))))
|
||||||
|
|
||||||
(defun doom-reload-autoloads ()
|
(defun doom-reload-autoloads ()
|
||||||
"Regenerate autoloads for DOOM emacs."
|
"Regenerate autoloads for DOOM emacs."
|
||||||
|
Reference in New Issue
Block a user