emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fixing refile cache use for org-goto in indirect buffers.
@ 2022-09-19  5:16 Yuchen Pei
  2022-09-19 15:48 ` Max Nikulin
  0 siblings, 1 reply; 5+ messages in thread
From: Yuchen Pei @ 2022-09-19  5:16 UTC (permalink / raw)
  To: emacs-orgmode mailing list

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] Fixing refile cache use for org-goto in indirect buffers.
@ 2022-09-19  5:16 Yuchen Pei
  0 siblings, 0 replies; 5+ messages in thread
From: Yuchen Pei @ 2022-09-19  5:16 UTC (permalink / raw)
  To: emacs-orgmode mailing list

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

Message-ID: <877d20vscj.fsf@ypei.org>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-20 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19  5:16 [PATCH] Fixing refile cache use for org-goto in indirect buffers Yuchen Pei
2022-09-19 15:48 ` Max Nikulin
2022-09-20 12:44   ` Yuchen Pei
2022-09-20 17:33     ` Max Nikulin
2022-09-19  5:16 Yuchen Pei

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).