emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rohit Patnaik" <quanticle@quanticle.net>
To: emacs-orgmode@gnu.org
Subject: Why do org-agenda-switch-to and org-agenda-goto put the point in different spots in the target buffer?
Date: Fri, 09 Sep 2022 00:49:56 -0500	[thread overview]
Message-ID: <f0c46480-b4ae-482e-94a0-33e9c3b99eed@www.fastmail.com> (raw)

I've gotten back into using org-agenda to manage my todos, and I noticed an odd discrepancy in behavior. When I hit RET in the agenda buffer to go to the TODO entry in the original org file, I see that the point is on the DEADLINE line. However, when I hit TAB, I find that the point is placed at the beginning of the heading. Looking at the source of org-agenda.el, I find that TAB is bound to `org-agenda-goto', which does the following:

(recenter (/ (window-height) 2))
(org-back-to-heading t)

RET, on the other hand, is bound to `org-agenda-switch-to', which does not have these lines, and thus does not place the point on the heading.

Is there a reason for this discrepancy between the two functions? I'm asking because I prefer the point placement behavior of `org-agenda-goto', but I use `org-agenda-switch-to' because switches to the target org file in the current window rather than opening a new window. Would there be any issues with me taking the recentering and point placement behavior from `org-agenda-goto' and adding it to `org-agenda-switch-to`?

Thanks,
Rohit


             reply	other threads:[~2022-09-09  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09  5:49 Rohit Patnaik [this message]
2022-09-09 10:25 ` Why do org-agenda-switch-to and org-agenda-goto put the point in different spots in the target buffer? Ihor Radchenko
2022-09-09 20:00   ` Rohit Patnaik
2022-09-10  6:02     ` Ihor Radchenko
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=f0c46480-b4ae-482e-94a0-33e9c3b99eed@www.fastmail.com \
    --to=quanticle@quanticle.net \
    --cc=emacs-orgmode@gnu.org \
    /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).