From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Shlyakhter Subject: Re: org-scan-tags Date: Wed, 15 Sep 2010 10:36:09 -0400 Message-ID: References: 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=52316 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ovt5r-00080D-T2 for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ovt5n-0006C1-Cu for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:36:15 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:34868) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ovt5n-0006Bu-7d for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:36:11 -0400 Received: by wwb24 with SMTP id 24so253455wwb.30 for ; Wed, 15 Sep 2010 07:36:10 -0700 (PDT) In-Reply-To: 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: emacs-orgmode Another question: if org-map-continue-from is used to skip parts of the file, could that affect the correctness of org-scanner-tags? I.e. is any code that sets org-map-continue-from also responsible for updating org-scanner-tags? thanks, ilya On Tue, Sep 14, 2010 at 11:19 PM, Ilya Shlyakhter w= rote: > In org-scan-tags, if todo-only is t, would it be possible to speed > things up by changingthe regexp go to just the lines with a TODO > keyword? > I.e. in > > =A0(let* ((re (concat "^" outline-regexp " *\\(\\<\\(" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (mapconcat 'regexp-quote org-todo= -keywords-1 "\\|") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-re > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"\\>\\)\\)? *\\(.*?\\)\\(:[[:a= lnum:]_@:]+:\\)?[ \t]*$"))) > > remove the first "?" if todo-only is t. =A0 Also, regexp-opt might make > a more efficient regexp than mapconcat with regexp-quote. > > Reason for request: =A0I'm writing an extension of org for setting & > checking goals, and want to quickly find entries with headlines of the > form > =A0 =A0GOAL .... > of which there may be relatively few in a large file. =A0 So, stepping > through all entries and then checking them for the GOAL keyword is > very inefficient. > It would be much faster if the regexp included the GOAL as a keyword. > > It would be good if the parameter todo-only could be a list of > strings, and org-scan-tags would return only the headlines where the > todo keyword is from this list. > It could use regexp-opt to make an efficient regexp for this. > > There also seem to be other opportunities for speeding up > org-scan-tags in this way: e.g. if the match string includes +mytag, > the regexp for the headline could include this as well. > Similarly for properties. =A0Maybe, org-make-tags-matcher could return a > list of tags and properties that must appear in any matching entry. > > It would also help if the tags matcher expression could refer to text > properties stored on the headline -- perhaps, with conditions such as > :myprop=3DX =A0(i.e. same as for org properties, but property name must b= e > a keyword). =A0 It already does this for the 'org-category text > property. > =A0Then one can e.g. mark entries representing unmet goals with text > properties, and then use a regular org-tags-view to browse them in a > sparsetree > or an agenda. > > Thanks, > > ilya >