Refactor doom/reload-autoloads
This commit is contained in:
parent
14967f084a
commit
24ca2a4163
1 changed files with 12 additions and 12 deletions
|
@ -352,22 +352,22 @@ the commandline."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom-initialize-packages noninteractive)
|
(doom-initialize-packages noninteractive)
|
||||||
(let ((generated-autoload-file doom-autoload-file)
|
(let ((generated-autoload-file doom-autoload-file)
|
||||||
autoload-files)
|
(autoload-files
|
||||||
(setq autoload-files
|
(append (-flatten (--map (let ((auto-dir (f-expand "autoload" it))
|
||||||
(append (-flatten (--map (let ((auto-dir (f-expand "autoload" it))
|
(auto-file (f-expand "autoload.el" it)))
|
||||||
(auto-file (f-expand "autoload.el" it)))
|
(append (and (f-exists-p auto-file)
|
||||||
(append (and (f-exists-p auto-file)
|
(list auto-file))
|
||||||
(list auto-file))
|
(and (f-directory-p auto-dir)
|
||||||
(and (f-directory-p auto-dir)
|
(f-glob "*.el" auto-dir))))
|
||||||
(f-glob "*.el" auto-dir))))
|
(--map (doom-module-path (car it) (cdr it))
|
||||||
(--map (doom-module-path (car it) (cdr it))
|
(doom--module-pairs))))
|
||||||
(doom--module-pairs))))
|
(f-glob "autoload/*.el" doom-core-dir))))
|
||||||
(f-glob "autoload/*.el" doom-core-dir)))
|
|
||||||
(when (f-exists-p generated-autoload-file)
|
(when (f-exists-p generated-autoload-file)
|
||||||
(f-delete generated-autoload-file)
|
(f-delete generated-autoload-file)
|
||||||
(message "Deleted old autoloads.el"))
|
(message "Deleted old autoloads.el"))
|
||||||
(dolist (file autoload-files)
|
(dolist (file autoload-files)
|
||||||
(@quiet (update-file-autoloads file))
|
(let ((inhibit-message t))
|
||||||
|
(update-file-autoloads file))
|
||||||
(message "Scanned %s" (f-relative file doom-emacs-dir)))
|
(message "Scanned %s" (f-relative file doom-emacs-dir)))
|
||||||
(condition-case ex
|
(condition-case ex
|
||||||
(with-current-buffer (get-file-buffer generated-autoload-file)
|
(with-current-buffer (get-file-buffer generated-autoload-file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue