If you want to get rid of extra blank lines in your text files, you can use the search and replace commands with regular expressions. However, for whatever reason, this does not work properly on my Windows machine.
Fortunately, I found a nice function definition at stackoverflow which does the job:
1 2 3 4 5 6 7 |
(defun single-lines-only () "replace multiple blank lines with a single one" (interactive) (goto-char (point-min)) (while (re-search-forward "\\(^\\s-*$\\)\n" nil t) (replace-match "\n") (forward-char 1))) |
http://stackoverflow.com/questions/4419576/delete-extra-blank-lines-in-emacs