From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Fix org-refile-cache-check-set Date: Fri, 21 May 2010 23:53:26 -0400 Message-ID: <878w7cvb94.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=33356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFfqW-0002pl-K1 for emacs-orgmode@gnu.org; Fri, 21 May 2010 23:57:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFfqV-0005C2-2g for emacs-orgmode@gnu.org; Fri, 21 May 2010 23:57:56 -0400 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:40333) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFfqU-0005Bu-R5 for emacs-orgmode@gnu.org; Fri, 21 May 2010 23:57:55 -0400 Received: from archdesk (adsl-99-190-81-18.dsl.klmzmi.sbcglobal.net [99.190.81.18]) by mail.messagingengine.com (Postfix) with ESMTPSA id AD57649C41B for ; Fri, 21 May 2010 23:57:53 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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