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

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

Re: repexp to collapse multiple blank lines into one


From: Neon Absentius
Subject: Re: repexp to collapse multiple blank lines into one
Date: Sun, 9 Oct 2005 13:44:54 +0000
User-agent: Mutt/1.4.2.1i

On Sun, Oct 09, 2005 at 12:27:07PM +0000, B. T. Raven wrote:
> Is there a way to use M-C-% to flush extra blank lines from a buffer.
> Something like:
> Query replace regexp:  ^$+ [which of course doesn't work, presumably
> because $ has to be last]
> with:      C-j
> 

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,
> 
> Ed
> 

-- 
 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]