Skip to content

Commit

Permalink
fix(core): first file stuff loaded immediately when in daemon mode
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 8, 2023
1 parent c38c671 commit 5711ac8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion elisp/+minemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ Executed before `after-find-file', it runs all hooks in `%s' and provide the `%s
(run-hooks ',hook-name)))
(if (daemonp)
;; Load immediately after init when in daemon mode
(add-hook 'after-init-hook #',fn-name 90)
(add-hook
'after-init-hook
(lambda ()
(provide ',feature-name)
(run-hooks ',hook-name))
#',fn-name 90)
(advice-add 'after-find-file :before #',fn-name '((depth . -101)))))))

;; From Doom Emacs
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
;; minemacs-lazy' can be loaded then it incrementally run the hooks in
;; `minemacs-lazy-hook' when Emacs goes idle.
(defun +minemacs--loaded-h ()
(+log! "=============== Loaded Emacs ===============")
(+log! "=============== Loaded Emacs%s ===============" (if (daemonp) " (in daemon mode)" ""))
(+info! "Loaded Emacs in %s." (emacs-init-time))

;; When running in an async Org export context, there is no need to set
Expand Down

0 comments on commit 5711ac8

Please sign in to comment.