From: Ihor Radchenko <yantar92@posteo.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-agenda-later sometimes creates a void display [9.7.11 (release_9.7.11 @ /usr/local/share/emacs/31.0.50/lisp/org/)]
Date: Sat, 11 Jan 2025 14:39:59 +0000 [thread overview]
Message-ID: <8734hp1kjk.fsf@localhost> (raw)
In-Reply-To: <87ttadqati.fsf@web.de>
[-- Attachment #1: Type: text/plain, Size: 889 bytes --]
Michael Heerdegen <michael_heerdegen@web.de> writes:
>> Please, do try to follow
>> https://orgmode.org/manual/Feedback.html#Feedback and provide detailed
>> steps showing how to reproduce the problem you are seeing without your
>> personal config.
>
> This will be a lot of work. I really hope we can avoid it.
One way or another I need a reproducer to test whether any given fix
makes sense.
Now, I created one.
1. emacs -Q
2. Open the attached org file
3. M-x org-agenda < a RET
4. Move to the week of items
5. Move point to "Sunday"
6. f
7. Observe buffer being scrolled all the way up
> What I am seeing is what one sees for any window showing a sufficiently
> large buffer after evaluating something like
>
> (setf (window-start) (+ 10 (point-max)))
Thanks! That did help to create a reproducer.
Please try the attached patch.
Let me know if it fixes things on your side.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-later-Avoid-scrolling-the-window-past-poi.patch --]
[-- Type: text/x-patch, Size: 1370 bytes --]
From c3bc1954b7b0427b2ab9f7563c960841c1410a55 Mon Sep 17 00:00:00 2001
Message-ID: <c3bc1954b7b0427b2ab9f7563c960841c1410a55.1736606174.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sat, 11 Jan 2025 15:33:31 +0100
Subject: [PATCH] org-agenda-later: Avoid scrolling the window past point
* lisp/org-agenda.el (org-agenda-later): When previous agenda buffer
is larger and its scroll position is beyond point position in the new
agenda buffer, do not try to restore scroll state. (Doing otherwise,
scrolls past the point, leading to unpredictable results - depending
on `scroll-conservatively'.
Reported-by: Michael Heerdegen <michael_heerdegen@web.de>
Link: https://orgmode.org/list/87ttadqati.fsf@web.de
---
lisp/org-agenda.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 884b9de782..2bab159795 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8789,7 +8789,8 @@ (defun org-agenda-later (arg)
(list (car args) sd span)))
(org-agenda-redo)
(org-agenda-find-same-or-today-or-agenda cnt))
- (set-window-start nil wstart)))
+ (unless (< (point) wstart) ; do no scroll past the point
+ (set-window-start nil wstart))))
(defun org-agenda-earlier (arg)
"Go backward in time by the current span in the agenda buffer.
--
2.47.1
[-- Attachment #3: bug.org --]
[-- Type: application/vnd.lotus-organizer, Size: 1440 bytes --]
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO This
SCHEDULED: <2025-01-08 Wed>
* TODO That
SCHEDULED: <2025-01-13 Mon>
[-- Attachment #4: Type: text/plain, Size: 223 bytes --]
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
prev parent reply other threads:[~2025-01-11 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-05 0:29 [BUG] org-agenda-later sometimes creates a void display [9.7.11 (release_9.7.11 @ /usr/local/share/emacs/31.0.50/lisp/org/)] Michael Heerdegen
2025-01-05 8:52 ` Ihor Radchenko
2025-01-05 18:18 ` Michael Heerdegen
2025-01-05 18:31 ` Ihor Radchenko
2025-01-05 20:12 ` Michael Heerdegen
2025-01-11 14:39 ` Ihor Radchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8734hp1kjk.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).