Refactor doom/reload-autoloads

This commit is contained in:
Henrik Lissner 2017-02-13 04:50:04 -05:00
parent 14967f084a
commit 24ca2a4163

View file

@ -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)