emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: Bastien <bastien.guerry@wikimedia.fr>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
	Carsten Dominik <carsten.dominik@gmail.com>
Subject: Re: org-scan-tags
Date: Fri, 4 Feb 2011 19:36:31 -0500	[thread overview]
Message-ID: <AANLkTikVbB5povrV1wR0S8TEaAdZyxrKN2daoOuszkJ6@mail.gmail.com> (raw)
In-Reply-To: <8739o59irw.fsf@gnu.org>

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 <bastien.guerry@wikimedia.fr> wrote:
> Carsten Dominik <carsten.dominik@gmail.com> 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
>

      parent reply	other threads:[~2011-02-05  0:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  3:19 org-scan-tags Ilya Shlyakhter
2010-09-15 14:36 ` org-scan-tags Ilya Shlyakhter
2010-09-15 16:13 ` org-scan-tags Ilya Shlyakhter
2011-02-02 23:17 ` org-scan-tags Bastien
2011-02-03  5:32 ` org-scan-tags Carsten Dominik
2011-02-03 16:13   ` org-scan-tags Carsten Dominik
2011-02-03 16:37     ` org-scan-tags Bastien
2011-02-03 16:47       ` org-scan-tags Carsten Dominik
2011-02-05  0:36       ` Ilya Shlyakhter [this message]

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=AANLkTikVbB5povrV1wR0S8TEaAdZyxrKN2daoOuszkJ6@mail.gmail.com \
    --to=ilya_shl@alum.mit.edu \
    --cc=bastien.guerry@wikimedia.fr \
    --cc=carsten.dominik@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).