emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* using rgrep, ag, etc in folded org files?
@ 2016-09-11 16:13 joakim
  2016-09-12 15:36 ` Aaron Ecay
  2016-09-12 23:04 ` Adam Porter
  0 siblings, 2 replies; 5+ messages in thread
From: joakim @ 2016-09-11 16:13 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I would like to use ag search, or rgrep etc, to jump to matches in my
org files, and have the matched lines tree be unfolded.

- isearch works in a folded orgfile
- jumping with occur in a folded file works
- rgrep, ag, etc doesnt unfold the tree where the match is


I found this 6 year old thread discussing the same issue:
"org-mode, grep and folding issue".

The thread described some workarounds which used agenda search or
something like that. I would rather like to use helm-projectile though.

Is it possible?
-- 
Joakim Verona

-- 
Joakim Verona

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

* Re: using rgrep, ag, etc in folded org files?
  2016-09-11 16:13 using rgrep, ag, etc in folded org files? joakim
@ 2016-09-12 15:36 ` Aaron Ecay
  2016-09-12 16:14   ` Clément Pit--Claudel
  2016-09-12 23:04 ` Adam Porter
  1 sibling, 1 reply; 5+ messages in thread
From: Aaron Ecay @ 2016-09-12 15:36 UTC (permalink / raw)
  To: joakim, emacs-orgmode

Hi Joakim,

The function org-reveal needs to be run after the search is executed.
If you are using the built-in emacs rgrep (for example), I think you
need to add a function to next-error-hook.  Grep for “add-hook
'occur-mode-find-occurrence-hook” in org.el for inspiration.

(Arguably this hook function should be added to org-mode, if enough
people find it useful).

-- 
Aaron Ecay

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

* Re: using rgrep, ag, etc in folded org files?
  2016-09-12 15:36 ` Aaron Ecay
@ 2016-09-12 16:14   ` Clément Pit--Claudel
  2016-09-13  9:20     ` Stig Brautaset
  0 siblings, 1 reply; 5+ messages in thread
From: Clément Pit--Claudel @ 2016-09-12 16:14 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 168 bytes --]

On 2016-09-12 11:36, Aaron Ecay wrote:
> (Arguably this hook function should be added to org-mode, if enough
> people find it useful).

That would be brilliant.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: using rgrep, ag, etc in folded org files?
  2016-09-11 16:13 using rgrep, ag, etc in folded org files? joakim
  2016-09-12 15:36 ` Aaron Ecay
@ 2016-09-12 23:04 ` Adam Porter
  1 sibling, 0 replies; 5+ messages in thread
From: Adam Porter @ 2016-09-12 23:04 UTC (permalink / raw)
  To: emacs-orgmode

You might find this package useful (it's mine ;):

https://github.com/alphapapa/helm-org-rifle

Or you can install it from MELPA.

I have plans to look into using external tools to find matches someday.
git grep seems like the most promising, but maybe ag or agrep could work
too.  In the meantime, you may find the existing functionality useful.
It wouldn't be hard to customize it slightly to do what you want,
although you might like the feature to open selected subtrees in
indirect buffers.  Please feel free to give feedback on the tracker.  :)

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

* Re: using rgrep, ag, etc in folded org files?
  2016-09-12 16:14   ` Clément Pit--Claudel
@ 2016-09-13  9:20     ` Stig Brautaset
  0 siblings, 0 replies; 5+ messages in thread
From: Stig Brautaset @ 2016-09-13  9:20 UTC (permalink / raw)
  To: emacs-orgmode

Clément Pit--Claudel <clement.pit@gmail.com> writes:

> On 2016-09-12 11:36, Aaron Ecay wrote:
>> (Arguably this hook function should be added to org-mode, if enough
>> people find it useful).
>
> That would be brilliant.

Adding my +1 to this, particularly if that would expand stuff in ediff
merge situations also! 

Stig

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

end of thread, other threads:[~2016-09-13  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-11 16:13 using rgrep, ag, etc in folded org files? joakim
2016-09-12 15:36 ` Aaron Ecay
2016-09-12 16:14   ` Clément Pit--Claudel
2016-09-13  9:20     ` Stig Brautaset
2016-09-12 23:04 ` Adam Porter

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