Do not recenter Org agenda after refreshing

This advice is experimental.  It should actually not move point, but after
executing `org-agenda-redo-all`, point is at the first position of the buffer.
Further investigation necessary.
This commit is contained in:
Daniel - 2022-10-15 16:59:34 +02:00
parent 548ba2c61b
commit 4997f21bec
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 8 additions and 1 deletions

View File

@ -1234,7 +1234,14 @@ respectively."
(add-hook 'org-agenda-mode-hook #'hl-line-mode 'append)
(advice-add 'org-agenda
:before #'db/check-special-org-files-in-agenda)))
:before #'db/check-special-org-files-in-agenda)
(define-advice org-agenda-redo-all (:around (old-func &rest r) goto-top-and-execute)
"Avoid recentering the Org agenda buffer after redo by moving
point to the beginning of buffer first."
(save-mark-and-excursion
(goto-char (point-min))
(apply old-func r)))))
;; Capturing