Subject: | TODO states are not reset with repeated calls to parse -- even for new Org::Parser objects |
Date: | Thu, 28 Aug 2014 06:23:33 +0300 |
To: | "bug-Org-Parser [...] rt.cpan.org" <bug-Org-Parser [...] rt.cpan.org> |
From: | Bernt Budde <bernt.budde [...] gmail.com> |
Hi,
Me again! :-)
$ perl -MData::Dumper -MOrg::Parser -E \
'$op=Org::Parser->new(); $doc = $op->parse("#+TODO: TODO FOO | DONE\n*
FOO DUH"); say Dumper $doc; say "-" x 70; $doc= $op->parse("#+TODO: TODO
BAR | DONE\n* BAR duh"); say Dumper $doc;'
The first document is OK, the second one fails to set BAR as TODO state.
For the first document it is:
'text' => 'DUH',
For the second document it is:
'text' => 'BAR
duh',
That is, it seems to only set the TODO states once in a call.
It doesn't even help if you create a new parse object with an added
$op=Org::Parser->new(); before the second call to parse().
(This took some time to find since I read through my own code a few times
first; it is getting light outside again, so I won't go over your code and
find the problem. :-) If you haven't fixed this when I have time next, I'll
look more at it myself.)
Thanks,
/Bernt Budde
PS
As you might remember, I'm trying to make a simple web subset of an Org
editor with Org::Parser.
While checking out TODO:s I almost fell over backwards when I saw this:
https://www.gnu.org/software/emacs/manual/html_node/org/Per_002dfile-keywords.html
Look at the "A setup for using several sets in parallel would be:" part.
I.e., Org Mode allows several sets of todo keywords and switching _inside_
a given subset! Totally new to me. Really cool.
The problem is that my todo list for my editor seems to be longer than my
present code. :-)
DS