Discussion:
Find All (occur) results to an indirect buffer?
(too old to reply)
Kerry Imming
2013-09-13 16:08:00 UTC
Permalink
Apologies if my terminology is not correct.

There are commands to find all lines containing an expression and to clone a
buffer into an indirect buffer, i.e.
M-x occur
M-x make-indirect-buffer

Is there a way to find all lines matching an expression and put them into an
indirect buffer?
The goal is to find a bunch of non-contiguous lines and gather them for edit
in the virtual buffer, where those edits will update the original source.

- Kerry
Michael Heerdegen
2013-09-13 19:17:41 UTC
Permalink
Hello Kerry,
Post by Kerry Imming
There are commands to find all lines containing an expression and to
clone a buffer into an indirect buffer, i.e. M-x occur M-x
make-indirect-buffer
Is there a way to find all lines matching an expression and put them
into an indirect buffer? The goal is to find a bunch of
non-contiguous lines and gather them for edit in the virtual buffer,
where those edits will update the original source.
There's no need for indirect buffers here. Indirect buffers always
share the entire content with their base buffers, so they are of no use
here.

If you are using occur and your Emacs is new enough (23 is too old), you
can hit e in the occur buffer to make it writable. All changes are
directly propagated to the base buffer. I think that's exactly what you
want.

There are other means to do something like that, like moccur-edit.el for
color-moccur.el or wgrep.el for grep buffers.


Michael.
Kerry Imming
2013-09-14 12:46:44 UTC
Permalink
Post by Michael Heerdegen
There's no need for indirect buffers here. Indirect buffers always
share the entire content with their base buffers, so they are of no use
here.
If you are using occur and your Emacs is new enough (23 is too old), you
can hit e in the occur buffer to make it writable. All changes are
directly propagated to the base buffer. I think that's exactly what you
want.
There are other means to do something like that, like moccur-edit.el for
color-moccur.el or wgrep.el for grep buffers.
Excellent. Thanks Michael.
I was running version 21, but I got it to work after upgrading.

- Kerry

Continue reading on narkive:
Loading...