New proposed function doesn't do what I want
stephen at inf.ed.ac.uk
Mon Aug 16 14:08:54 CEST 2004
As well as the code that Tom posted, have you seen the function
delete-blank-lines bound to C-x C-o in Emacs?
C-x C-o runs the command delete-blank-lines
which is an interactive compiled Lisp function in `simple'.
On blank line, delete all surrounding blank lines, leaving just one.
On isolated blank line, delete that one.
On nonblank line, delete any immediately following blank lines.
Rodney Sparapani writes:
> Does anyone know why this function doesn't quite work? I want to change all
> multiple blank lines into one blank line.
> (defun ess-delete-blank-lines ()
> "Convert 2 or more lines of white space into one. This function
> works as you might expect, except that it must be terminated by C-g
> for some reason and it also removes single blank lines?!?"
> (goto-char (point-min))
> (while (search-forward-regexp "^[ \t]*$" nil 'eof 2)
> Rodney Sparapani Medical College of Wisconsin
> Sr. Biostatistician Patient Care & Outcomes Research
> rsparapa at mcw.edu http://www.mcw.edu/pcor
> Was 'Name That Tune' rigged? WWLD -- What Would Lombardi Do
> ESS-help at stat.math.ethz.ch mailing list
More information about the ESS-help