From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Error because org-refile calls org-back-to-heading Date: Mon, 22 Aug 2011 09:28:43 -0500 Message-ID: <87ei0dbjvo.fsf@fastmail.fm> References: <877h65h8ye.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvVUf-0007GG-Jy for emacs-orgmode@gnu.org; Mon, 22 Aug 2011 10:28:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvVUb-0000Mu-CX for emacs-orgmode@gnu.org; Mon, 22 Aug 2011 10:28:49 -0400 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:33644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvVUb-0000Mf-4X for emacs-orgmode@gnu.org; Mon, 22 Aug 2011 10:28:45 -0400 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.messagingengine.com (Postfix) with ESMTP id 6B03920181 for ; Mon, 22 Aug 2011 10:28:44 -0400 (EDT) Received: from archdesk (wcnat-96-226.wheaton.edu [209.147.96.226]) by mail.messagingengine.com (Postfix) with ESMTPSA id 20D1D860C7D for ; Mon, 22 Aug 2011 10:28:44 -0400 (EDT) In-Reply-To: <877h65h8ye.fsf@fastmail.fm> (Matt Lundin's message of "Mon, 22 Aug 2011 08:28:09 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --=-=-= Content-Type: text/plain Matt Lundin writes: > Since the commit c25165c25dc9fdb5b57b3c66b2e0ec0efdbeb7ad on August 18, > I can only call this function when I am beneath the first level heading > of an org-mode file. Otherwise I receive the following error: Here's a patch that allows one to call (org-refile t) in a non org-mode buffer without resulting in an error. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-No-need-to-call-org-back-to-heading-with-goto-argume.patch >From 785f08ec86017df72bf3b30fdbd522c8ff0f4cb5 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Mon, 22 Aug 2011 09:26:57 -0500 Subject: [PATCH] No need to call org-back-to-heading with goto argument. * lisp/org.el: (org-refile) Don't call org-back-to-heading with goto argument. This fixes an error that results when calling org-refile with the GOTO argument in a non-org buffer. --- lisp/org.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index de8c72b..0c66828 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10495,7 +10495,7 @@ prefix argument (`C-u C-u C-u C-c C-w')." (setq goto nil))) (setq it (or rfloc (save-excursion - (org-back-to-heading t) + (unless goto (org-back-to-heading t)) (org-refile-get-location (cond (goto "Goto") (regionp "Refile region to") -- 1.7.6 --=-=-=--