1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

lisp/org-agenda.el: Prevent wrong scrolling

* lisp/org-agenda.el (org-agenda-later): Prevent window from
scrolling to the point when `scroll-conservatively' is > 101.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87lfh2hk4k.fsf@gmail.com/
This commit is contained in:
Bastien 2021-05-04 00:22:33 +02:00
parent dfc0d522f1
commit eecc0574d8

View File

@ -8311,7 +8311,8 @@ When optional argument BACKWARD is set, go backward."
With prefix ARG, go forward that many times the current span."
(interactive "p")
(org-agenda-check-type t 'agenda)
(let* ((args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))
(let* ((wstart (window-start))
(args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))
(span (or (nth 2 args) org-agenda-current-span))
(sd (or (nth 1 args) (org-get-at-bol 'day) org-starting-day))
(greg (calendar-gregorian-from-absolute sd))
@ -8344,7 +8345,8 @@ With prefix ARG, go forward that many times the current span."
(org-agenda-overriding-arguments
(list (car args) sd span)))
(org-agenda-redo)
(org-agenda-find-same-or-today-or-agenda cnt))))
(org-agenda-find-same-or-today-or-agenda cnt))
(set-window-start nil wstart)))
(defun org-agenda-earlier (arg)
"Go backward in time by the current span.