From: Nick Dokos <nicholas.dokos@hp.com>
To: bala mayam <balamayam@gmail.com>, emacs-orgmode@gnu.org
Cc: nicholas.dokos@hp.com
Subject: Re: Possibly Bug in function org-scan-tags
Date: Fri, 16 Dec 2011 02:16:11 -0500 [thread overview]
Message-ID: <10391.1324019771@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Nick Dokos <nicholas.dokos@hp.com> of "Fri, 16 Dec 2011 01:41:41 EST." <9379.1324017701@alphaville.dokosmarshall.org>
Nick Dokos <nicholas.dokos@hp.com> 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
next prev parent reply other threads:[~2011-12-16 7:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 1:18 Possibly Bug in function org-scan-tags bala subramaniyam
2011-12-15 22:56 ` bala mayam
2011-12-16 6:41 ` Nick Dokos
2011-12-16 7:16 ` Nick Dokos [this message]
2011-12-16 23:05 ` Nick Dokos
2011-12-31 8:29 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10391.1324019771@alphaville.dokosmarshall.org \
--to=nicholas.dokos@hp.com \
--cc=balamayam@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).