From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: Re: org-scan-tags Date: Fri, 4 Feb 2011 19:36:31 -0500 Message-ID: References: <6A0ECD8D-8BB6-4BD6-9EC3-E6F4B09D0288@gmail.com> <8D6872F5-4087-4581-A2D9-735CBE2B112E@gmail.com> <8739o59irw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=43723 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlW8g-0003fs-VB for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 19:36:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlW8f-0002u1-Sr for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 19:36:34 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:61117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlW8f-0002tm-KR for emacs-orgmode@gnu.org; Fri, 04 Feb 2011 19:36:33 -0500 Received: by bwz16 with SMTP id 16so3337040bwz.0 for ; Fri, 04 Feb 2011 16:36:31 -0800 (PST) In-Reply-To: <8739o59irw.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode , Carsten Dominik 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 wrot= e: > Carsten Dominik writes: > >> OK, here is an example where it really does fail: >> >> >> * heading >> ** one =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:tag1: >> *** two >> *** two =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:tag2: >> *** TODO two =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 :tag2: >> *** two =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0: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. =A0I reverted the commit, > it should be fine again. > > -- > =A0Bastien >