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: Neon Absentius
Subject: Re: regexp to collapse multiple blank lines into one
Date: Mon, 10 Oct 2005 19:06:37 +0000
User-agent: Mutt/1.4.2.1i

On Mon, Oct 10, 2005 at 12:33:50PM -0600, Kevin Rodgers wrote:

> 
> In any case, replacing \(^ C-q C-j \)+ with \1 is 10 key strokes, which
> is actually more typing than if you were to replace ^ C-q C-j + with C-q
> C-j (6 keys).
> 

Yes indeed.  I didn't think of it.  I just wrote the first think
that came to my mind and it worked.  About the keystrokes though I
think that C-q shoud count for more than 1 keystroke; perhaps not 2
keystrokes but 1.5 so your solution has really 8 keystrokes :).
Still my solution is not that bad because it is general: a simple
modification of it will work whenever one whishes to replace
multiple occurences of a regexp with a single occurence.

Also on most files using ^ C-q C-j \{2,\} will save you a lot a
keystrokes because one won't have to press all these "y".

-- 
 There is no national science just as there is no national
multiplication table; what is national is no longer science.
         -- Anton Checov




reply via email to

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