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).
This commit is contained in:
Matt Lundin 2010-05-22 08:53:26 +00:00 committed by John Wiegley
parent 4c6012f831
commit bb912d6d7c
1 changed files with 8 additions and 7 deletions

View File

@ -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."