Mercurial > emacs
changeset 34141:799f637fbc35
(delete-trailing-whitespace): Don't delete newlines too.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 03 Dec 2000 02:28:07 +0000 |
parents | 0e73fed6473e |
children | e10d50a60aaf |
files | lisp/simple.el |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/simple.el Sat Dec 02 21:57:41 2000 +0000 +++ b/lisp/simple.el Sun Dec 03 02:28:07 2000 +0000 @@ -232,9 +232,11 @@ (interactive "*") (save-match-data (save-excursion + (let (eol bol) (goto-char (point-min)) - (while (re-search-forward "\\s-+$" nil t) - (delete-region (match-beginning 0) (match-end 0)))))) + (while (re-search-forward "\\s-$" nil t) + (skip-syntax-backward "-" (save-excursion (forward-line 0) (point))) + (delete-region (point) (match-end 0))))))) (defun newline-and-indent () "Insert a newline, then indent according to major mode.