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)
|
||||
(doom-initialize-packages noninteractive)
|
||||
(let ((generated-autoload-file doom-autoload-file)
|
||||
autoload-files)
|
||||
(setq autoload-files
|
||||
(append (-flatten (--map (let ((auto-dir (f-expand "autoload" it))
|
||||
(auto-file (f-expand "autoload.el" it)))
|
||||
(append (and (f-exists-p auto-file)
|
||||
(list auto-file))
|
||||
(and (f-directory-p auto-dir)
|
||||
(f-glob "*.el" auto-dir))))
|
||||
(--map (doom-module-path (car it) (cdr it))
|
||||
(doom--module-pairs))))
|
||||
(f-glob "autoload/*.el" doom-core-dir)))
|
||||
(autoload-files
|
||||
(append (-flatten (--map (let ((auto-dir (f-expand "autoload" it))
|
||||
(auto-file (f-expand "autoload.el" it)))
|
||||
(append (and (f-exists-p auto-file)
|
||||
(list auto-file))
|
||||
(and (f-directory-p auto-dir)
|
||||
(f-glob "*.el" auto-dir))))
|
||||
(--map (doom-module-path (car it) (cdr it))
|
||||
(doom--module-pairs))))
|
||||
(f-glob "autoload/*.el" doom-core-dir))))
|
||||
(when (f-exists-p generated-autoload-file)
|
||||
(f-delete generated-autoload-file)
|
||||
(message "Deleted old autoloads.el"))
|
||||
(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)))
|
||||
(condition-case ex
|
||||
(with-current-buffer (get-file-buffer generated-autoload-file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue