Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!THEORY.LCS.MIT.EDU!bard From: bard@THEORY.LCS.MIT.EDU (Bard Bloom) Newsgroups: comp.emacs Subject: Removing blank lines Message-ID: <8803141524.AA02089@TOUCAN.LCS.MIT.EDU> Date: 14 Mar 88 15:24:54 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 11 > >> 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