emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Rohit Patnaik <quanticle@quanticle.net>
Cc: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87fsgzzrzu.fsf@localhost> (raw)
In-Reply-To: <eb910161-c4bc-4918-876c-f108a7b58510@www.fastmail.com>

"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	other threads:[~2022-09-10  6:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  5:49 Why do org-agenda-switch-to and org-agenda-goto put the point in different spots in the target buffer? Rohit Patnaik
2022-09-09 10:25 ` Ihor Radchenko
2022-09-09 20:00   ` Rohit Patnaik
2022-09-10  6:02     ` Ihor Radchenko [this message]
2022-09-11 13:30     ` Max Nikulin

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=87fsgzzrzu.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=quanticle@quanticle.net \
    /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).