Rewrite doom-reload + load-path bootstrap code
This commit is contained in:
parent
df851e3fd5
commit
b8ff7dfd4a
1 changed files with 28 additions and 9 deletions
|
@ -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."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue