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 6LTjM04pHGOVJQEAbAwnHQ (envelope-from ) for ; Sat, 10 Sep 2022 08:06:06 +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 AIAGM04pHGPx3QAAG6o9tA (envelope-from ) for ; Sat, 10 Sep 2022 08:06:06 +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 60870C2F7 for ; Sat, 10 Sep 2022 08:06:06 +0200 (CEST) Received: from localhost ([::1]:37972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWtcz-0006Aw-82 for larch@yhetil.org; Sat, 10 Sep 2022 02:06:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWtYx-00068R-OA for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 02:01:55 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:55867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWtYu-0001AH-Uy for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 02:01:55 -0400 Received: by mail-pj1-x102b.google.com with SMTP id fs14so3307745pjb.5 for ; Fri, 09 Sep 2022 23:01:52 -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=M5dR7EoQiZo6Lci1X3lTKZqMSlbBbLvRcZ+DzazJOck=; b=osN/QcNFF9n8dN5VzlnxIYZtO5jk4iPG02z9CaCu/Wm10rsLvri41bgEJfS2o1kIoz O9Q59LloSFEM2KNo+Z5pyrmhSrobmA0W2+mrFzqcb2Xc08H2h8OTbnLrbL2V4p3L8gNk Bx51d2FhWcRP6aE+c71xsYOUgVRmHtxivN8i8cXkm6PkVGy7Rp+I3EWBKBnil4hNM4W5 JnPZCNnqdkU6dm0JKjRl/bTlULTzkS4NMl10Gi+sTvTP8WctS9NCbVlz0nNjQAD+eulY 0JjUETylQft2+Us7D6380Oap1bJmO63eHJbxRK04sVhitTtuHemdtI5cTAqKZTjqGdni 4qrg== 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=M5dR7EoQiZo6Lci1X3lTKZqMSlbBbLvRcZ+DzazJOck=; b=VaHtZhMTa5jcXKGMaXLVH4vGuXhZIBf3egSTjxVvQ9dyVImx6haP5zsg3J3wcNRJ5P 8DuFk5VPnl+wA4SGnqH5aCLXNp2KUsfWcRMGajAGBbdAQEjnd8z2nsazVCKFZ/eYMaKv KNeAWvuC7tRPgkvD+89c43xFvWmU/hHiEGnDm0GCOYL4O4gF4hxEEdEml9EztHS2mSep 6KmOyB/b/laZngi0kzDMsUiSUuNosfkf7dX0BW0aUJ3M4rfIf7YdlKmAhhY13YcxzEit 3olwxAWnEQtQKqfoAkzg9f6fRVyANKsteD2RUkYFvP9jpAZhbjhbhlAuhoJLof6QZr8l Xd2Q== X-Gm-Message-State: ACgBeo3cj9bIdakmum6oA27Z2Jv7ImMnP2d4l7ybBGcjvb5UysQmRvHO 4TClJsUl8bpdMNnPHmM34n9zX8sGmmGHLw== X-Google-Smtp-Source: AA6agR5/nEv6DmQ4qPfsPMHBnAzvnJSL9B2QAps2JRcTf8JAiKkCfRCB5QvK679TOPB2Yj+hKSGwHw== X-Received: by 2002:a17:90a:c02:b0:1fb:b69d:140f with SMTP id 2-20020a17090a0c0200b001fbb69d140fmr13076468pjs.139.1662789711457; Fri, 09 Sep 2022 23:01:51 -0700 (PDT) Received: from localhost ([1.83.154.15]) by smtp.gmail.com with ESMTPSA id q2-20020a170902bd8200b00176ab6a0d5fsm1474503pls.54.2022.09.09.23.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 23:01:51 -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: <87y1usdeu0.fsf@localhost> Date: Sat, 10 Sep 2022 14:02:45 +0800 Message-ID: <87fsgzzrzu.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102b.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=1662789966; 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=M5dR7EoQiZo6Lci1X3lTKZqMSlbBbLvRcZ+DzazJOck=; b=U+QgT4hl+jWF21o+xHm4qyyjIOybGqAfCG10Il0dkkxTM3eBDRSSQBZwT7WDh9fFU5CL8O TN8n/K/eveh323eL39xJpKrh8qljE4TQzJfQ/rVlbjocab8Q/kK1/AGvu17lZeBX0RtJEs twmeARjFhbG1aCBNil0Plu2NJ71CDqKJDLsU0MRX1e0zrwt9kcvSikf36r/tV35PsgnQFn PDuwHhQPGQFTKISRODSM3nkDsvGDZmzUROCfcBC2DRuVY4Bi88UWekt4jVrrGybZKtZKEC Z/QA5xA1nBhjupZK3qbdhyAAnRB2UT/YYSjkXb01EzCzLt1nbgyetp+InCabag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662789966; a=rsa-sha256; cv=none; b=MNW3Z8gMoVt0/N9COAUqaBRcylTycpCA4MV2TcB/wXGgTJnhvfBbdt+K0Kp8p3kQEyysdw FH34LAA17Ybrk1VTtTyRAhRfkdbD5h0k5YP6+NdWEtqsAw1li1dmld6RS0J0BT1J1IK8W1 Pj8a/kshW9xvH3Bsda53IwQZIiiah3xLXXNHMjNSuefaEIjj1QqvtQz2PpNQWFfsMJA5aS onjwxov4mV35kbU2BGqeWOEocgsa46lddaZLU99CT8Yj/qFE/hL1m5pVUAYJad98YTkRLt cZShIcmT1P7c4zq348A/I8rJ6sfXHdpY++xMzetW/+NcbAZHVjhzvoS7nmzxDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="osN/QcNF"; 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: -0.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="osN/QcNF"; 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: 60870C2F7 X-Spam-Score: -0.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: U+z8q25kvbt8 "Rohit Patnaik" 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