mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-05-17 08:59:15 -07:00
refactor(dashboard): reduce work on init
And set `doom-fallback-buffer-name` and `initial-buffer-choice` sooner (makes it easier for users to override).
This commit is contained in:
parent
8f97fe4aff
commit
77f2b5abbb
1 changed files with 2 additions and 3 deletions
|
|
@ -224,13 +224,10 @@ dashboard reloading is inhibited.")
|
|||
(unless noninteractive
|
||||
;; Ensure the dashboard becomes Emacs' go-to buffer when there's nothing
|
||||
;; else to show.
|
||||
(setq doom-fallback-buffer-name +dashboard-name
|
||||
initial-buffer-choice #'doom-fallback-buffer)
|
||||
(unless fancy-splash-image
|
||||
(setq fancy-splash-image
|
||||
(expand-file-name +dashboard-banner-file
|
||||
+dashboard-banner-dir)))
|
||||
(+dashboard-reload)
|
||||
(add-hook 'doom-load-theme-hook #'+dashboard-reload-on-theme-change-h)
|
||||
;; Ensure the dashboard is up-to-date whenever it is switched to or resized.
|
||||
(add-hook 'window-size-change-functions #'+dashboard-resize-h)
|
||||
|
|
@ -245,6 +242,8 @@ dashboard reloading is inhibited.")
|
|||
(add-hook 'persp-activated-functions #'+dashboard-reload-maybe-h))
|
||||
(add-hook 'persp-before-switch-functions #'+dashboard--persp-record-project-h)))
|
||||
|
||||
(setq doom-fallback-buffer-name +dashboard-name
|
||||
initial-buffer-choice #'doom-fallback-buffer)
|
||||
(add-hook 'doom-init-ui-hook #'+dashboard-init-h 'append)
|
||||
|
||||
;; PERF: Make sure the dashboard is ready early, so as to avoid triggering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue