diff options
author | Matt Lundin <mdl@imapmail.org> | 2010-05-22 08:53:26 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-05-26 14:14:47 -0600 |
commit | bb912d6d7cd2f73bdabd65197feebe8c5990e004 (patch) | |
tree | 7f4be561c0736a9a51bd9194b70d929be63d9e18 | |
parent | 4c6012f831e918dd74b498b18e37fc49410ad925 (diff) | |
download | org-mode-bb912d6d7cd2f73bdabd65197feebe8c5990e004.tar.gz |
Fix org-refile-cache-check-set
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).
-rw-r--r-- | lisp/org.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el index 496eceb..5f1b2a2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9537,13 +9537,14 @@ on the system \"/user@host:\"." (defun org-refile-cache-check-set (set) "Check if all the markers in the cache still have live buffers." - (catch 'exit - (while set - (if (not (marker-buffer (nth 3 (pop set)))) - (progn - (message "not found") (sit-for 3) - (throw 'exit nil)))) - t)) + (let (marker) + (catch 'exit + (while (and set (setq marker (nth 3 (pop set)))) + ;; if org-refile-use-outline-path is 'file, marker may be nil + (when (and marker (null (marker-buffer marker))) + (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." |