[comp.emacs] Removing blank lines

bard@THEORY.LCS.MIT.EDU (Bard Bloom) (03/14/88)

> >> A specific way of doing what you want with blank lines is to remove all
> >> occurrences of the string ^J^J (i.e.  a blank line consists of the
> >> string newline-newline)
> 
> Ahem ... removing them would glue the surrounding non-blank lines
> together.  You have to replace occurences of ^J^J with ^J.  If there
> are stretches of more than one blank line, you may have to do this
> more than once on the buffer.

Replace-regexp ^J^J+ with ^J seems to work.

-- Bard