Keep track of packages + show package count on splash screen

This commit is contained in:
Henrik Lissner 2016-10-06 17:20:13 +02:00
parent 9149bee237
commit 5f6cfeb225
3 changed files with 22 additions and 14 deletions

View file

@ -298,11 +298,12 @@ non-nil."
"Reload `load-path' and `custom-theme-load-path', in case you updated cask "Reload `load-path' and `custom-theme-load-path', in case you updated cask
while emacs was open!" while emacs was open!"
(interactive) (interactive)
(let ((-load-path (let* ((-packages-path (--subdirs doom-packages-dir))
(-load-path
(append (list doom-private-dir doom-core-dir doom-modules-dir doom-packages-dir) (append (list doom-private-dir doom-core-dir doom-modules-dir doom-packages-dir)
(--subdirs doom-core-dir t) (--subdirs doom-core-dir t)
(--subdirs doom-modules-dir t) (--subdirs doom-modules-dir t)
(--subdirs doom-packages-dir) -packages-path
(--subdirs (expand-file-name (format "../../%s/bootstrap" emacs-version) (--subdirs (expand-file-name (format "../../%s/bootstrap" emacs-version)
doom-packages-dir)) doom-packages-dir))
doom--load-path)) doom--load-path))
@ -313,7 +314,9 @@ while emacs was open!"
custom-theme-load-path -custom-theme-load-path) custom-theme-load-path -custom-theme-load-path)
(if (called-interactively-p 'interactive) (if (called-interactively-p 'interactive)
(message "Reloaded!") (message "Reloaded!")
(list -load-path -custom-theme-load-path)))) (list -load-path
-custom-theme-load-path
(mapcar '--subdirs -packages-path)))))
(defun doom-reload-autoloads () (defun doom-reload-autoloads ()
"Regenerate and reload autoloads.el." "Regenerate and reload autoloads.el."

View file

@ -114,7 +114,8 @@ buffer. Without this, it would refuse to split, saying 'too small to split'."
"\n\n\n" "\n\n\n"
(propertize (concat (s-center 78 "~ ~") (propertize (concat (s-center 78 "~ ~")
"\n" "\n"
(s-center 78 (format "Loaded in %s" (emacs-init-time)))) (s-center 78 (format "Loaded %d packages in %s"
(length doom-packages) (emacs-init-time))))
'face 'font-lock-comment-face)) 'face 'font-lock-comment-face))
(setq doom--scratch-width width (setq doom--scratch-width width
doom--scratch-height height))) doom--scratch-height height)))

View file

@ -156,6 +156,9 @@ major-modes, the process gets killed.")
"Initial `load-path', used as a base so we don't clobber it on consecutive "Initial `load-path', used as a base so we don't clobber it on consecutive
reloads.") reloads.")
(defvar doom-packages '()
"A list of all installed packages. Filled internally; do not edit it!")
;; Just the bear necessities... ♫ ;; Just the bear necessities... ♫
(setq load-path (append (list doom-core-dir) doom--load-path)) (setq load-path (append (list doom-core-dir) doom--load-path))
@ -164,7 +167,8 @@ reloads.")
(require 'core-defuns) (require 'core-defuns)
(let ((paths (eval-when-compile (doom-reload)))) (let ((paths (eval-when-compile (doom-reload))))
(setq load-path (car paths) (setq load-path (car paths)
custom-theme-load-path (cadr paths))) custom-theme-load-path (cadr paths)
doom-packages (caddr paths)))
;; Many functions are lazy-loaded. The autoloads.el file contains info on where ;; Many functions are lazy-loaded. The autoloads.el file contains info on where
;; to find them if they're called. Tries to generate autoloads.el if one isn't ;; to find them if they're called. Tries to generate autoloads.el if one isn't