From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-scan-tags Date: Thu, 3 Feb 2011 06:32:19 +0100 Message-ID: <6A0ECD8D-8BB6-4BD6-9EC3-E6F4B09D0288@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=44753 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkrnu-0002hq-N0 for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 00:32:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pkrnt-0006Xy-Ec for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 00:32:26 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:40853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pkrnt-0006Xu-9f for emacs-orgmode@gnu.org; Thu, 03 Feb 2011 00:32:25 -0500 Received: by bwz16 with SMTP id 16so1328013bwz.0 for ; Wed, 02 Feb 2011 21:32:23 -0800 (PST) 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: Ilya Shlyakhter Cc: emacs-orgmode On Sep 15, 2010, at 5:19 AM, Ilya Shlyakhter wrote: > 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 believe this may cause a problem. The scanner needs to see at least every parent node to be able to collect all inherited tags. So I think that a tree like * heading ** one :tag1: *** TODO two :tag2: would incorrectly miss out on :tag1: - Carsten > I.e. in > > (let* ((re (concat "^" outline-regexp " *\\(\\<\\(" > (mapconcat 'regexp-quote org-todo-keywords-1 "\ > \|") > (org-re > "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)? > [ \t]*$"))) > > remove the first "?" if todo-only is t. Also, regexp-opt might make > a more efficient regexp than mapconcat with regexp-quote. > > Reason for request: I'm writing an extension of org for setting & > checking goals, and want to quickly find entries with headlines of the > form > GOAL .... > of which there may be relatively few in a large file. 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. Maybe, 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=X (i.e. same as for org properties, but property name must be > a keyword). It already does this for the 'org-category text > property. > Then 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 > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode