help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Narrow buffer to the results of an isearch?


From: B. T. Raven
Subject: Re: Narrow buffer to the results of an isearch?
Date: Fri, 07 Oct 2005 16:37:28 GMT

"Ryan Newton" <rrnewton@gmail.com> wrote in message
news:mailman.10276.1128699759.20277.help-gnu-emacs@gnu.org...
> Maybe this is impossible, I certainly haven't found anything on it
yet.
>
> What I want is to mask the current buffer to all lines matching an
> search.  Unfortunately I don't know if narrow-to-region can be used
> for this, because the region is defined as a continuous area of text
> between the mark and the point.
>
> Has anyone hacked up support for discontinuous regions?  Or some
> other way that I can filter the buffer to only my lines of interest?
>
> --Ryan
>
>
>

Since the emacs buffer is only a copy of the visited file, you could
shell out to the operating system, run 'sed' (Unix stream editor) on the
file, pipe the output to temp, and then read temp into another buffer,
or even insert it into or append it to the original buffer. It might
even be possible to automate this entire process with a little help from
elisp and your friends. Rather than isearch, you will probably want to
use the more powerful search regexp.

Ed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]