Fix #4759: suppressed doom-first-file-hook side-effects
An optimization that minimizes how much work is done when grabbing org agenda files in the background prevented side-effects in doom-first-file-hook. This had the indirect effect of preventing save-place-mode from adding its hook to find-file-hook IF org-agenda was the first thing you ran at startup.
This commit is contained in:
parent
61ae935fe4
commit
9f08db8e33
1 changed files with 9 additions and 5 deletions
|
@ -611,10 +611,13 @@ mutating hooks on exported output, like formatters."
|
||||||
|
|
||||||
(defun +org--restart-mode-h ()
|
(defun +org--restart-mode-h ()
|
||||||
"Restart `org-mode', but only once."
|
"Restart `org-mode', but only once."
|
||||||
(quiet! (org-mode-restart))
|
|
||||||
(delq! (current-buffer) org-agenda-new-buffers)
|
|
||||||
(remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
(remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
||||||
'local))
|
'local)
|
||||||
|
(delq! (current-buffer) org-agenda-new-buffers)
|
||||||
|
(let ((file buffer-file-name)
|
||||||
|
(inhibit-redisplay t))
|
||||||
|
(kill-buffer)
|
||||||
|
(find-file file)))
|
||||||
|
|
||||||
(add-hook! 'org-agenda-finalize-hook
|
(add-hook! 'org-agenda-finalize-hook
|
||||||
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
(defun +org-exclude-agenda-buffers-from-workspace-h ()
|
||||||
|
@ -644,8 +647,9 @@ can grow up to be fully-fledged org-mode buffers."
|
||||||
:around #'org-get-agenda-file-buffer
|
:around #'org-get-agenda-file-buffer
|
||||||
(let ((recentf-exclude (list (lambda (_file) t)))
|
(let ((recentf-exclude (list (lambda (_file) t)))
|
||||||
(doom-inhibit-large-file-detection t)
|
(doom-inhibit-large-file-detection t)
|
||||||
find-file-hook
|
doom-first-file-hook
|
||||||
org-mode-hook)
|
org-mode-hook
|
||||||
|
find-file-hook)
|
||||||
(funcall orig-fn file)))
|
(funcall orig-fn file)))
|
||||||
|
|
||||||
;; HACK With https://code.orgmode.org/bzg/org-mode/commit/48da60f4, inline
|
;; HACK With https://code.orgmode.org/bzg/org-mode/commit/48da60f4, inline
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue