From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +/cICKcBKGPOxgAAbAwnHQ (envelope-from ) for ; Mon, 19 Sep 2022 07:44:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id ULoWB6cBKGMygwAA9RJhRA (envelope-from ) for ; Mon, 19 Sep 2022 07:44:07 +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 5882D238B9 for ; Mon, 19 Sep 2022 07:44:06 +0200 (CEST) Received: from localhost ([::1]:40940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oa9Zd-00005s-0n for larch@yhetil.org; Mon, 19 Sep 2022 01:44:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa9VQ-0007tZ-8z for emacs-orgmode@gnu.org; Mon, 19 Sep 2022 01:39:44 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa9VO-0000mk-Gy for emacs-orgmode@gnu.org; Mon, 19 Sep 2022 01:39:43 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 049275C0258 for ; Mon, 19 Sep 2022 01:39:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 19 Sep 2022 01:39:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ypei.org; h=cc :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t= 1663565982; x=1663652382; bh=CRGTMqt2ZHZ3vi0F9xnrKz6Hvg3zhYLrLOU mOlaADVs=; b=WgvhhXAfnlEii3RyUG/JhZ897W6uZmS49QsVOD4luSXFR9CAEmX XXH0SjexFVT2mUmmqGjFYVFwX4i5hjebZF/dRacg3ZUov7cVP8fndfQ0EKkPJJHa nyOXZkRNKL+OMyoVqkxG28RWyvpB87KAMoJpYx0DErt1c91b1eEjPfItANGXwIux Ulo98kWUMktEFo36L5yaIP8osfEiWrZf82KDHHt7I7ZighCCb9bgACAF2RIIQlbK Z93izGpRvCbB4KDxzM5kOz6PPEJZ3V0UKeF2vbJR+WGb07ioaaKDqSdBYNuQtVCz aHipYD12bq3ZRxsvcjmGD8ezMP2OElCviQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1663565982; x= 1663652382; bh=CRGTMqt2ZHZ3vi0F9xnrKz6Hvg3zhYLrLOUmOlaADVs=; b=E T3E+0qEw9edRdouHJhhUWcPc8UBsh52QJbHTr7eCnY0IqyUsx668IYGSEL32vjqW cCQXvQAY8RBGmGdd8DqFGuu4UZr1rpRy+DHwZ31k5ANcTcerusjABLPa08Zc1Ytk f/T2SnENqj7nABnYTFfO4BVYVH/dcpqi4xUcMU9/POlA5z2ZL06Rga93QDmR0En9 WAJlAI7Wuxq9783Ygqs6PzIwiS3AjmVAi9eOmiXoxxrncwfTcGXj6PtB3qzsrI2b 9VQXA/9LYfzB5NyT5jdnHGjx/pJ81OCxLECfoFmqpP8hG1gS0yqNZSOdu+ArzmlC /9EuUiTOtHJOQEizwik0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedviedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfggtgesthdtredttddttdenucfhrhhomhepjghutghhvghnucfr vghiuceoihguseihphgvihdrohhrgheqnecuggftrfgrthhtvghrnhepueevhefgvefgje eihfegfffggeeuhfevkeeiudevhfeutefhkefhgffgtddvheelnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguseihphgvihdrohhrgh X-ME-Proxy: Feedback-ID: i51b146f9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 19 Sep 2022 01:39:40 -0400 (EDT) From: Yuchen Pei To: emacs-orgmode mailing list Subject: [PATCH] Fixing refile cache use for org-goto in indirect buffers. Date: Mon, 19 Sep 2022 15:16:31 +1000 Signed-off-by: Yuchen Pei Message-ID: <87zgevvs6e.fsf@ypei.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.27; envelope-from=id@ypei.org; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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=1663566247; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CRGTMqt2ZHZ3vi0F9xnrKz6Hvg3zhYLrLOUmOlaADVs=; b=BwLRGY8WKKqsX+HUleHNwjEw5KHC4S+gsAGppjPdu8H+Lif/jSqxML6oQjW/CcxWzHTg8e okrFAhqCUBuWW4PxKeULsauElgaGrIfZKD/E3CdQ9DueXTU4q68u0TrN2rd3iyJlk3tiBt 8fBZPrf+pmplTHZjhibCAUFmdmqXqBwYEDv/bhL/sSOd+85HtGh/bz7TBxDvkPufOf9d1A 0JnezqMxvyMluRFGjY5GhXitJTNNqM5puOjZVuqKlo0gCcFHnlCe4C4vikGZPtRod6A9xA Fuh/LJ17PWHiA8EY2jeOY16MztJ4p00DJg28uL3cafROJDRVecLRTTRU2GQURA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663566247; a=rsa-sha256; cv=none; b=OzpDMs37GtORL4OSy5W7R9hIiQEMMW9wKZOnsyYJ5WX0QYlcGqU97+b6/m9kZ4hfh/EgKc rUxUFkAPQ1MeSKONYZ49/gNJ+2eQdBagRreXZzBaqctyjVnTeM9i5zaDMciRe71emSIJHF g2H/4l7UhQymSBJwdzMSSJdrsv/9UmhZmeYYt3vh9rBuz1bPgLqVqCzKB2xIlCxSIV/GGv IyqeUq/z8A/uemqABFP3Gn+ZvyR//JV/Jm9WQD2IEcmfUtMTEuVWnAXapfheT7Nm3J/xJ7 oHBEqw+tOSvwwx9lwAPVB0D3di3Qd9KoisfaC+0tcKuGKa3ITKOHDjFNRIIOwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ypei.org header.s=fm3 header.b=WgvhhXAf; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="E T3E+0q"; dmarc=none; 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: 1.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ypei.org header.s=fm3 header.b=WgvhhXAf; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="E T3E+0q"; dmarc=none; 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: 5882D238B9 X-Spam-Score: 1.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: jPpcNRgCKX0y To reprod: - make sure the org-refile-targets generates a big enough list where the refile cache makes a difference - visit an org file in org-refile-targets - M-x clone-indirect-buffer-other-window - C-0 C-c C-w to clear cache - M-: (org-refile-get-targets) - org-goto in the original buffer takes no effort - but, org-goto in the indirect buffer takes time, which is unexpected. --- lisp/org-refile.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 16cff25bd..7189ef595 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -306,7 +306,10 @@ converted to a headline before refiling." (dolist (f files) (with-current-buffer (if (bufferp f) f (org-get-agenda-file-buffer f)) (or - (setq tgs (org-refile-cache-get (buffer-file-name) descre)) + (setq tgs (org-refile-cache-get + (buffer-file-name (when (bufferp f) + (buffer-base-buffer f))) + descre)) (progn (when (bufferp f) (setq f (buffer-file-name (buffer-base-buffer f)))) -- 2.37.3