From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yM9YKBQVG2PKqQAAbAwnHQ (envelope-from ) for ; Fri, 09 Sep 2022 12:27:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oGRqJxQVG2Pg9gAAG6o9tA (envelope-from ) for ; Fri, 09 Sep 2022 12:27:32 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 488781134D for ; Fri, 9 Sep 2022 12:27:32 +0200 (CEST) Received: from localhost ([::1]:41326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWbER-0007Ve-BG for larch@yhetil.org; Fri, 09 Sep 2022 06:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWbBs-0007VO-PH for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 06:24:52 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:40954) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWbBq-0007Cm-VS for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 06:24:52 -0400 Received: by mail-pf1-x432.google.com with SMTP id b144so1240623pfb.7 for ; Fri, 09 Sep 2022 03:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=GnQ2B/h3cfV013rW3iQCe8zqlgzrZTnOtwP/ziYiH38=; b=AYFGjB6vSKbVuzQPizTBomB1rZ6/Q/7Zlmew7a/zTcCN5o73CVbxxjLRpyYUmXOBX2 tc4tXPTd+fOU/X4IsK34YyvPf6coXf7t/7YC38PYMgTIw62xzW4pyVkDgExSLojeOE0B MzGAGKH4CdnWxCPegIPC6/ZwD08Ws339z3Ir490fVaMFBos88MN95wB+DtlHO+A6583/ G5NPJVVkCZrUINaufbGzIf+HEkT1EGRoASaJBPAXtd1kiKvOZsJ7ZalVg9ZKWERlp/Ll XlLl8jWaxUQ/2Gu45igaDhGYVdsts2ZvthNwn7a+5Ri8x6DUarGihJxkYwh4/6mQNh6p j5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=GnQ2B/h3cfV013rW3iQCe8zqlgzrZTnOtwP/ziYiH38=; b=FmPafLDjxOP075F5w4DSUMeZPsfK/r3nO0NMC4vBVMNUV8ar9NoVdHT9bgZpS5HODP hXUsmC4GjHSFBYGOIUu9r1HR/FG3iC9dtTrzkju1EWo8vNZQgjP8XknnkwtEGUH3CIkU j5z0PzX5KRGDVBwE7MUNoFXWxazbEQd2YboKB50ooATQCftqdAHEzVUnOafo+GDvcXC5 u3GMdMUSnL5GpCPRIlFRcP+lUqDIdVrYVp3pdbE1xrso3pX0bNONZRXIXtJA1325vPDJ rNs2y7a3tbucaIqKB7i7xeSiJFFRuZKEuJ8poEwPDJLbOcg/dPmi5/1JoS7E6lMDnhtx 8Vrw== X-Gm-Message-State: ACgBeo0riVpInCQes8Wy0m0jp8csittBdg3EmJjugA/+lBVP5BqUksn9 3Kulsr8+vFeJEuJrchkRO0FRnNWpOR4= X-Google-Smtp-Source: AA6agR50RV0CnsT9VOj10vHoPXvB/F6gymbTT3u8CxfCVZLlhJaErfR/m3xac885Slm98w5O1k5Odw== X-Received: by 2002:a63:1954:0:b0:438:79da:7849 with SMTP id 20-20020a631954000000b0043879da7849mr3675198pgz.527.1662719089419; Fri, 09 Sep 2022 03:24:49 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id x22-20020a1709027c1600b0016c5306917fsm176395pll.53.2022.09.09.03.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:24:48 -0700 (PDT) From: Ihor Radchenko To: Rohit Patnaik 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? In-Reply-To: References: Date: Fri, 09 Sep 2022 18:25:43 +0800 Message-ID: <87y1usdeu0.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=yantar92@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662719252; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=GnQ2B/h3cfV013rW3iQCe8zqlgzrZTnOtwP/ziYiH38=; b=nClgKZRMdqGfXZgBqh9UE+P/uBEIOAT76ZdS92WzzacU0wenp4DNUto1mTD1pmmDeoY8Nw ICdEhHXR0ah7wLjLy9JP9rL6z6TaQi0d7OQoxKMc6QtGFajkryKCVx6QC4Or2fHQ/q3HIK BHJi1FkSlIk/BeUsoSu3E09UsOtnjeNy+nAiCzfzUCj/+js1UadyQEgu9+iRtApeM0Jxr+ X8Wd/Jqp8Hsi1UnKKJVQmNTQmQKRAU13WSbneAGu2SrSpK019R/5jBmSAN3bMYF69qXx49 w+aCGFmGOJOjb5ne6QYDe7IUgKqcrn5aylqGZtIP3wC8sBWUqlK6vPZnfu9afw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662719252; a=rsa-sha256; cv=none; b=ud39/duh5fPS32Ohe/NC9bh4wcE0oKr2v+bEs5nCnj189yr8e7UgcmRuUAPizH4JHXdKDo bYYQ98fg31zpIDIAPXldjJOoOehqaclHLXC/WbnwESuRagSKCTIBUZmfGuMZKvYxHDsZ0d 7/jtapLmNKx5WvLRZJyjc952wD5lAUcADBBSrLwyxj6d/cmlNGiG15UNcmmm5VCp0y4reQ CvNFGNL1GbNzhpDYI3FH8t0oZmSjGv5YXrG41gAe+4wQ9i6mYG/elimm0l7KNMJsjlzJvy KaDJ09ajxVd/VFSLL8UmzJsL4bjVcal4Hk4YnOzkprn1Zj+RhJTl0wTc2TNCcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AYFGjB6v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.60 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AYFGjB6v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 488781134D X-Spam-Score: -7.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: us3JM0UkHWHh "Rohit Patnaik" writes: > 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. org-agenda-switch-to jumps to the actual agenda match (usually a timestamp). It may or may not be close to the headline (think of active timestamp inside notes). Such behaviour, albeit undocumented, may be useful for some users. I'd rather not change it. If you want to force org-agenda-switch-to to jump back to headline, you can modify org-agenda-after-show-hook. > 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`? Recentering is purely a visual thing. It should be safe to add. -- 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