[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-scan-tags

From: Ilya Shlyakhter
Subject: Re: [Orgmode] org-scan-tags
Date: Fri, 4 Feb 2011 19:36:31 -0500

Thanks for catching this, Carsten!

This could perhaps be fixed by doing a full lookup of the tags up the
hierarchy, rather than relying on the cached tags.
This is more expensive, but if fewer entries actually have to be
looked at (because the search only stops at TODO entries),
it might be faster overall.

One general way to speed up searches would be to move as much work as
possible into Emacs' built-in regexp matcher.
When parsing a search expression, right now it is parsed into an elisp
form that is evaluated at each entry and says
whether the entry matches.   Each clause of a search expression could
instead be parsed into an elisp form _and_ a regexp,
such that matching the regexp would be a necessary (but not
sufficient) condition for the entry to match.
E.g. if looking for entries with property PROP equal to 1, you could
construct a regexp that would match only that.
Some things aren't expressible in regexp language so they'd still have
to be checked in lisp.  And tag lookups could not use the
cache.   But if most of the filtering is done by Emacs' regexp
matcher, and only a bit of lisp filtering on top of that,
overall searches might be faster.

On Thu, Feb 3, 2011 at 11:37 AM, Bastien <address@hidden> wrote:
> Carsten Dominik <address@hidden> writes:
>> OK, here is an example where it really does fail:
>> * heading
>> ** one                                                        :tag1:
>> *** two
>> *** two                                                              :tag2:
>> *** TODO two                                                         :tag2:
>> *** two                                                              :tag2:
>> Fold up the tree, then do
>> C-c / m +tag1/! RET
>> This should find the "TODO two", but it does not, because the
>> new regexp moves right past the "one" line and so tag1 is
>> overlooked.
> Right, thanks for the detailed example.  I reverted the commit,
> it should be fine again.
> --
>  Bastien

reply via email to

[Prev in Thread] Current Thread [Next in Thread]