fix: trigger doom-first-{file,buffer}-hook at startup
Should fix issues where modes/hooks weren't triggered for files/directories opened early (e.g. from the command-line or programmatically from the user's config).
This commit is contained in:
parent
35dd2bb33c
commit
c53f63b96e
1 changed files with 9 additions and 0 deletions
|
@ -322,6 +322,15 @@ If RETURN-P, return the message as a string instead of displaying it."
|
|||
(doom-run-hook-on 'doom-first-buffer-hook '(find-file-hook doom-switch-buffer-hook))
|
||||
(doom-run-hook-on 'doom-first-file-hook '(find-file-hook dired-initial-position-hook))
|
||||
(doom-run-hook-on 'doom-first-input-hook '(pre-command-hook))
|
||||
|
||||
;; If the user's already opened something (e.g. with command-line arguments),
|
||||
;; then we should assume nothing about the user's intentions and simply treat
|
||||
;; this session as fully initialized.
|
||||
(add-hook! 'doom-after-init-hook :depth 100
|
||||
(defun doom-run-first-hooks-if-files-open-h ()
|
||||
(when file-name-history
|
||||
(doom-run-hooks 'doom-first-file-hook 'doom-first-buffer-hook))))
|
||||
|
||||
;; PERF: Activate these later, otherwise they'll fire for every buffer created
|
||||
;; between now and the end of startup.
|
||||
(add-hook! 'after-init-hook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue