emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Ilya Shlyakhter <ilya_shl@alum.mit.edu>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-scan-tags
Date: Thu, 3 Feb 2011 17:13:38 +0100	[thread overview]
Message-ID: <8D6872F5-4087-4581-A2D9-735CBE2B112E@gmail.com> (raw)
In-Reply-To: <6A0ECD8D-8BB6-4BD6-9EC3-E6F4B09D0288@gmail.com>


On Feb 3, 2011, at 6:32 AM, Carsten Dominik wrote:

>
> 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:


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.

- Carsten




>
> - 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
>

  reply	other threads:[~2011-02-03 16:13 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   ` Carsten Dominik [this message]
2011-02-03 16:37     ` org-scan-tags Bastien
2011-02-03 16:47       ` org-scan-tags Carsten Dominik
2011-02-05  0:36       ` org-scan-tags Ilya Shlyakhter

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=8D6872F5-4087-4581-A2D9-735CBE2B112E@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ilya_shl@alum.mit.edu \
    /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).