emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] org-scan-tags


From: Ilya Shlyakhter
Subject: [Orgmode] org-scan-tags
Date: Tue, 14 Sep 2010 23:19:21 -0400

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

  (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



reply via email to

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