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

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

Re: regexp to collapse multiple blank lines into one


From: Kevin Rodgers
Subject: Re: regexp to collapse multiple blank lines into one
Date: Mon, 10 Oct 2005 10:35:01 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

B. T. Raven wrote:
> "Neon Absentius" <absent@sdf.lonestar.org> wrote in message
> news:mailman.10556.1128865819.20277.help-gnu-emacs@gnu.org...
>>The following seems to work
>>
>>C-M-% \(^C-qC-j\)+ RET \1 RET
>>
>>Provided of course that your lines are really blank and do not contain
>>any spaces, tabs etc.
>
> Thanks F.L., P.D., N.A. Neon's solution seems the easiest to me. I need
> this only because I can't get control chars into the replacement string.
> The replacement can be a bare RET but you can't replace with less than
> nothing, i.e. replacing a regexp with nothing and then backspacing to
> get rid of the blank line.

Why can't you use the same technique to put a control character into the
replacement string as Neon suggests for the search string/regexp
(namely, C-q)?

I'll admit, I don't understand why that solution works: it appears to
replace the matched sequence of LFD characters with itself, instead of
replacing it with just a single LFD character (or nothing at all,
depending on the desired result).

> Could this be related to the fact that
> C-<spacebar> is no longer bound to 'set-mark'? It used to be, but now
> C-h k reports nothing, (in fact, doesn't react at all) to that keypress.

No.  When you type C-SPC, your terminal is no longer sending anything
for Emacs to interpret.  Try C-@ instead.

--
Kevin Rodgers






reply via email to

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