emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why do org-agenda-switch-to and org-agenda-goto put the point in dif


From: Ihor Radchenko
Subject: Re: Why do org-agenda-switch-to and org-agenda-goto put the point in different spots in the target buffer?
Date: Sat, 10 Sep 2022 14:02:45 +0800

"Rohit Patnaik" <quanticle@quanticle.net> writes:

>> Recentering is purely a visual thing. It should be safe to add.
>
> I've added the recentering behavior in the attached patch. The recentering 
> part
> was more important for me than the point jumping to the heading, because
> sometimes the match would appear at the very top of the screen and I'd have to
> scroll up manually to see the heading. If the screen is centered on the match,
> then it's likely that the heading will also be visible in the window.

Note that your previous contribution was around 15LOC. To contribute
further, you need to complete the FSF copyright assignment. See
https://orgmode.org/worg/org-contribute.html#copyright
The process normally takes less than 5 working days.

> @@ -9741,6 +9741,7 @@ displayed Org file fills the frame."
>        (goto-char pos)
>        (when (derived-mode-p 'org-mode)
>       (org-fold-show-context 'agenda)
> +        (recenter (/ (window-height) 2))

Another option could be extending org-fold-show-context-detail so that
one can set something like

((agenda . local recenter) ;; <---
 (bookmark-jump . lineage)
 (isearch . lineage)
 (default . ancestors))

It will be more flexible.

-- 
Ihor Radchenko,
Org mode contributor,
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]