unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* advanced search for patterns
@ 2021-01-04 22:19 hj-orgmode-1
  2021-01-04 22:36 ` Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: hj-orgmode-1 @ 2021-01-04 22:19 UTC (permalink / raw)
  To: emacs-orgmode

hello, I have been using orgmode for a while , and noticed that I can 
find headings based on tags, but I haven't figured out whether there is 
a way to say in emacs org-mode :

   find me all the (lowest-level) headings [ or heading-paths ] that 
contains text (whether formatted as source code blocks or whatever) that 
matches, say three, (regexp) patterns, e.g. :

    (M|m)artha
    ((buy|bought)[^\n]*milk(s?))
    (pay|paid|USD)

  How would one ask org-mode to find all such headings (in all opened 
org-mode buffers , preferably :) )

  I guess one could try to connect the three regexps with something like 
a negative-lookahead "does not contain '\n\*'" string, like

    (M|m)artha (:!\n\*){0}   ((buy|bought)[^\n]*milk(s?)) (:!\n\*){0}   
(pay|paid|USD)  |  \
    (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} 
((buy|bought)[^\n]*milk(s?))    |  \
    ((buy|bought)[^\n]*milk(s?))  (:!\n\*){0}   (M|m)artha (:!\n\*){0}   
(pay|paid|USD)  |  \
    (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0} 
((buy|bought)[^\n]*milk(s?))    |  \
     ...

  but that's just ugly. And would it work at all? Would it not be so 
slow to make it impractical?

   Or is there a way to say "search all headings for pattern1" in all 
files, then filter the results by pattern2, then filter the results by 
pattern3 ?? How? Someone surely must have done this before ...


    thx!!

     HJ



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: advanced search for patterns
  2021-01-04 22:19 advanced search for patterns hj-orgmode-1
@ 2021-01-04 22:36 ` Samuel Wales
  2021-01-04 22:38   ` Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Wales @ 2021-01-04 22:36 UTC (permalink / raw)
  To: hj-orgmode-1; +Cc: emacs-orgmode

with the correct variable settings, i think you can do

  {pat1} {pat2} {pat3} -{pat4}

you can check the manual for the search settings.


On 1/4/21, hj-orgmode-1@hj.proberto.com <hj-orgmode-1@hj.proberto.com> wrote:
> hello, I have been using orgmode for a while , and noticed that I can
> find headings based on tags, but I haven't figured out whether there is
> a way to say in emacs org-mode :
>
>    find me all the (lowest-level) headings [ or heading-paths ] that
> contains text (whether formatted as source code blocks or whatever) that
> matches, say three, (regexp) patterns, e.g. :
>
>     (M|m)artha
>     ((buy|bought)[^\n]*milk(s?))
>     (pay|paid|USD)
>
>   How would one ask org-mode to find all such headings (in all opened
> org-mode buffers , preferably :) )
>
>   I guess one could try to connect the three regexps with something like
> a negative-lookahead "does not contain '\n\*'" string, like
>
>     (M|m)artha (:!\n\*){0}   ((buy|bought)[^\n]*milk(s?)) (:!\n\*){0}
> (pay|paid|USD)  |  \
>     (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0}
> ((buy|bought)[^\n]*milk(s?))    |  \
>     ((buy|bought)[^\n]*milk(s?))  (:!\n\*){0}   (M|m)artha (:!\n\*){0}
> (pay|paid|USD)  |  \
>     (pay|paid|USD)  (:!\n\*){0} (M|m)artha (:!\n\*){0}
> ((buy|bought)[^\n]*milk(s?))    |  \
>      ...
>
>   but that's just ugly. And would it work at all? Would it not be so
> slow to make it impractical?
>
>    Or is there a way to say "search all headings for pattern1" in all
> files, then filter the results by pattern2, then filter the results by
> pattern3 ?? How? Someone surely must have done this before ...
>
>
>     thx!!
>
>      HJ
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: advanced search for patterns
  2021-01-04 22:36 ` Samuel Wales
@ 2021-01-04 22:38   ` Samuel Wales
  2021-01-06 17:28     ` advanced search for patterns [SOLVED] HJ
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Wales @ 2021-01-04 22:38 UTC (permalink / raw)
  To: hj-orgmode-1; +Cc: emacs-orgmode

correction:

  *{pat1} {pat2} {pat3} -{pat4}

should do the trick iiuc and if you have the varialbe setc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: advanced search for patterns [SOLVED]
  2021-01-04 22:38   ` Samuel Wales
@ 2021-01-06 17:28     ` HJ
  2021-01-06 20:58       ` Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: HJ @ 2021-01-06 17:28 UTC (permalink / raw)
  To: Samuel Wales, hj-orgmode-1; +Cc: emacs-orgmode


  Yes Samuel! This does work! Thank you! ( Although I haven't figured 
out yet which variable(s) you might be referring to ... )

  - HJ

On 1/4/21 11:38 PM, Samuel Wales wrote:
> correction:
>
>    *{pat1} {pat2} {pat3} -{pat4}
>
> should do the trick iiuc and if you have the varialbe setc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: advanced search for patterns [SOLVED]
  2021-01-06 17:28     ` advanced search for patterns [SOLVED] HJ
@ 2021-01-06 20:58       ` Samuel Wales
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Wales @ 2021-01-06 20:58 UTC (permalink / raw)
  To: HJ; +Cc: hj-orgmode-1, emacs-orgmode

you're welcome.

things like (setq org-agenda-search-view-always-boolean t)
(setq org-agenda-search-view-force-full-words t) in manual.

On 1/6/21, HJ <orgmode-1@hj.proberto.com> wrote:
>
>   Yes Samuel! This does work! Thank you! ( Although I haven't figured
> out yet which variable(s) you might be referring to ... )
>
>   - HJ
>
> On 1/4/21 11:38 PM, Samuel Wales wrote:
>> correction:
>>
>>    *{pat1} {pat2} {pat3} -{pat4}
>>
>> should do the trick iiuc and if you have the varialbe setc.
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-06 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 22:19 advanced search for patterns hj-orgmode-1
2021-01-04 22:36 ` Samuel Wales
2021-01-04 22:38   ` Samuel Wales
2021-01-06 17:28     ` advanced search for patterns [SOLVED] HJ
2021-01-06 20:58       ` Samuel Wales

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git