From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Possibly Bug in function org-scan-tags Date: Sat, 31 Dec 2011 09:29:11 +0100 Message-ID: <28C408EA-96C7-4FD7-B68D-477DA13E3087@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RguJb-00019r-DG for emacs-orgmode@gnu.org; Sat, 31 Dec 2011 03:29:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RguJZ-0000xq-7m for emacs-orgmode@gnu.org; Sat, 31 Dec 2011 03:29:19 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:35043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RguJZ-0000xX-0F for emacs-orgmode@gnu.org; Sat, 31 Dec 2011 03:29:17 -0500 Received: by eekc41 with SMTP id c41so15377239eek.0 for ; Sat, 31 Dec 2011 00:29:15 -0800 (PST) In-Reply-To: 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 subramaniyam Cc: emacs-orgmode@gnu.org I have just fixed this issue, in the spirit of Nicks proposal. Thanks! - Carsten On 15.12.2011, at 02:18, bala subramaniyam wrote: > Hi, > The variable "org-map-continue-from" is not reset to nil = after the funcall to action in function "org-scan-tags". >=20 > Heres the patch which works >=20 > diff --git a/lisp/org.el b/lisp/org.el > index 8a1fbd3..54ab5fb 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -12848,7 +12848,8 @@ only lines with a TODO keyword are included in = the output." > (setq org-map-continue-from nil) > (save-excursion > (setq rtn1 (funcall action)) > - (push rtn1 rtn))) > + (push rtn1 rtn)) > + (setq org-map-continue-from nil)) > (t (error "Invalid action"))) > =20 > ;; if we are to skip sublevels, jump to end of subtree >=20 > To see the error in action assume that we want to archive all the = "DONE" states in the file > /tmp/test.org which contains the following lines. > * s1 > ** DONE ss1 > ** NEXT ss2 >=20 >=20 > (defun my-org-archive-subtree () > (setq org-map-continue-from (point-at-bol)) > (org-archive-subtree)) >=20 > (org-map-entries 'my-org-archive-subtree "/DONE" (list = "/tmp/test.org")) >=20 > 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). >=20 > Regards, > Balamayam