emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix org-refile-cache-check-set
@ 2010-05-22  3:53 Matt Lundin
  0 siblings, 0 replies; only message in thread
From: Matt Lundin @ 2010-05-22  3:53 UTC (permalink / raw)
  To: Org Mode


Org-refile-cache fails when org-refile-use-outline-path is set to file.
Specifically, org-refile-cache-check-set throws a markerp error when it
encounters file targets, since they have nil instead a marker object.
This patch applies the test only to targets with markers (i.e.,
headings).
---
 lisp/org.el |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 496eceb..38e6a30 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9537,13 +9537,16 @@ on the system \"/user@host:\"."
 
 (defun org-refile-cache-check-set (set)
   "Check if all the markers in the cache still have live buffers."
+  (let (marker)
   (catch 'exit
-    (while set
-      (if (not (marker-buffer (nth 3 (pop set))))
-	  (progn
-	    (message "not found") (sit-for 3)
-	    (throw 'exit nil))))
-    t))
+    (while (setq marker (nth 3 (pop set)))
+      ;; if org-refile-use-outline-path is 'file, marker may be nil
+      (when marker
+	(if (not (marker-buffer marker))
+	    (progn
+	      (message "not found") (sit-for 3)
+	      (throw 'exit nil)))))
+    t)))
 
 (defun org-refile-cache-put (set &rest identifiers)
   "Push the refile targets SET into the cache, under IDENTIFIERS."
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-22  3:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-22  3:53 [PATCH] Fix org-refile-cache-check-set Matt Lundin

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