all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Saving results of grep-find in the original interactive format  ?
@ 2019-11-19 21:21 jonetsu
  2019-11-19 22:38 ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: jonetsu @ 2019-11-19 21:21 UTC (permalink / raw)
  To: Emacs mailing list

Is it possible to save the results of a grep-find search in such a
file format that would allow to load it back and have all the results
clickable again so that instantly it becomes possible to jump to those
files quickly as it was in the first place right after the search ?




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

* Re: Saving results of grep-find in the original interactive format ?
  2019-11-19 21:21 Saving results of grep-find in the original interactive format ? jonetsu
@ 2019-11-19 22:38 ` Nick Dokos
  2019-11-20 12:56   ` jonetsu
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2019-11-19 22:38 UTC (permalink / raw)
  To: help-gnu-emacs

jonetsu <jonetsu@teksavvy.com> writes:

> Is it possible to save the results of a grep-find search in such a
> file format that would allow to load it back and have all the results
> clickable again so that instantly it becomes possible to jump to those
> files quickly as it was in the first place right after the search ?

I just saved the grep buffer into a a file and killed the buffer. When
I opened the file again, everything was as before: you can jump to any
of the found places. What makes this possible is the first line of the
buffer that makes sure that when you open the file, it is in grep-mode
and the current directory is set to wherever the search was executed
in the first place:

,----
| -*- mode: grep; default-directory: "~/src/emacs/org/org-mode/worktrees/foo/" -*-
| Grep started at Tue Nov 19 17:29:57
| 
| grep --color -nH --null -e foo lisp/*.el
| lisp/ob-core.el^@456:their `org-babel-default-header-args:foo' variable.
| lisp/ob-core.el^@1571:#+PROPERTY: var foo=1, bar=2"
| lisp/ox-texinfo.el^@851:   ((org-element-property :footnote-section-p headline) nil)
| ...
| 
| Grep finished with 860 matches found at Tue Nov 19 17:29:57
`----

I replaced real NUL chars above with the string "^@" because gnus
warned me of potential problems when sending mail with NULs: in the
real file, they should be real NUL chars.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




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

* Re: Saving results of grep-find in the original interactive format ?
  2019-11-19 22:38 ` Nick Dokos
@ 2019-11-20 12:56   ` jonetsu
  0 siblings, 0 replies; 3+ messages in thread
From: jonetsu @ 2019-11-20 12:56 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, 19 Nov 2019 17:38:29 -0500
Nick Dokos <ndokos@gmail.com> wrote:

> I just saved the grep buffer into a a file and killed the buffer. When
> I opened the file again, everything was as before: you can jump to any
> of the found places. 

Thanks !  This great and so much useful.

Cheers.



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

end of thread, other threads:[~2019-11-20 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-19 21:21 Saving results of grep-find in the original interactive format ? jonetsu
2019-11-19 22:38 ` Nick Dokos
2019-11-20 12:56   ` jonetsu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.