Try a bit harder to avoid recentering after agenda buffer redo
New try: temporarily nullify `recenter`, seems to work so far and keeps point on the same line.
This commit is contained in:
parent
2407f4196f
commit
712a314923
15
init.el
15
init.el
@ -1071,12 +1071,15 @@
|
|||||||
(add-hook 'org-agenda-finalize-hook #'db/org-agenda-insert-active-filters)
|
(add-hook 'org-agenda-finalize-hook #'db/org-agenda-insert-active-filters)
|
||||||
(add-hook 'org-agenda-filter-hook #'org-agenda-redo-all)
|
(add-hook 'org-agenda-filter-hook #'org-agenda-redo-all)
|
||||||
|
|
||||||
(define-advice org-agenda-redo-all (:around (old-func &rest r) goto-top-and-execute)
|
(define-advice org-agenda-redo (:around
|
||||||
"Avoid recentering the Org agenda buffer after redo by moving
|
(actual-agenda-redo &rest r)
|
||||||
point to the beginning of buffer first."
|
inhibit-recentering)
|
||||||
(save-mark-and-excursion
|
"Try to avoid recentering the window when redoing the Org agenda buffer."
|
||||||
(goto-char (point-min))
|
(let ((old-recenter (symbol-function 'recenter)))
|
||||||
(apply old-func r)))))
|
(fset 'recenter 'identity)
|
||||||
|
(unwind-protect
|
||||||
|
(apply actual-agenda-redo r)
|
||||||
|
(fset 'recenter old-recenter))))))
|
||||||
|
|
||||||
;; Capturing
|
;; Capturing
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user