From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Possibly Bug in function org-scan-tags Date: Fri, 16 Dec 2011 02:16:11 -0500 Message-ID: <10391.1324019771@alphaville.dokosmarshall.org> References: <9379.1324017701@alphaville.dokosmarshall.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbS1f-0006BN-Fw for emacs-orgmode@gnu.org; Fri, 16 Dec 2011 02:16:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbS1e-0004Va-7i for emacs-orgmode@gnu.org; Fri, 16 Dec 2011 02:16:15 -0500 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:16559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbS1e-0004VL-2D for emacs-orgmode@gnu.org; Fri, 16 Dec 2011 02:16:14 -0500 In-Reply-To: Message from Nick Dokos of "Fri, 16 Dec 2011 01:41:41 EST." <9379.1324017701@alphaville.dokosmarshall.org> 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: bala mayam , emacs-orgmode@gnu.org Cc: nicholas.dokos@hp.com Nick Dokos wrote: > > While the org-scan-tags funciton parses the first subheading(**DONE ss1) the match is > > successful and the function "my-org-archive-subtree" is called which sets the variable > > "org-map-continue-from" value to *beginning of line* and this variable is not set back to nil > > after the function call ends, which leads to infinite loop while parsing the subsequent headlines > > which does not match the "DONE" state(**NEXT ss2). > > > > I think it's a bit much to expect org to avoid all possible infinite loops > that a user function can get it into - it's up to you to write the function > properly so that it does *not* lead to infinite loops. > > In this case, I think you can write > > --8<---------------cut here---------------start------------->8--- > (defun my-org-archive-subtree () > (let ((org-map-continue-from (point-at-bol))) > (org-archive-subtree))) > --8<---------------cut here---------------end--------------->8--- > > and be done with it - no changes to org needed. AFAICT, it deals with > both of your examples without going into an infinite loop. > > What am I missing? > Well, it doesn't go into an infinite loop but it doesn't work either, so scratch that. I'll need to think about it some more. Nick