From 4997f21becc4b3992f94336225ba2cf45489ad7f Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 15 Oct 2022 16:59:34 +0200 Subject: [PATCH] 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. --- init.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index fb52498..c165212 100644 --- a/init.el +++ b/init.el @@ -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