ui/modeline: minor startup optimization
Prevents project.el from being eager-loaded at startup.
This commit is contained in:
parent
79ac04f0b1
commit
1ce2b29193
2 changed files with 11 additions and 1 deletions
|
@ -27,6 +27,16 @@
|
|||
|
||||
(add-hook '+doom-dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
||||
|
||||
;; Don't eager-load project.el. Doom only uses projectile anyway, for now.
|
||||
(defun +modeline*project-root ()
|
||||
(or doom-modeline-project-root
|
||||
(setq doom-modeline-project-root
|
||||
(file-local-name
|
||||
(if (featurep 'projectile)
|
||||
(ignore-errors (projectile-project-root))
|
||||
default-directory)))))
|
||||
(advice-add #'doom-modeline-project-root :override #'+modeline*project-root)
|
||||
|
||||
;; Magit -- modeline only where it's useful
|
||||
(defun +modeline|hide-in-non-status-buffer ()
|
||||
(if (eq major-mode 'magit-status-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue