# HG changeset patch # User Gerd Moellmann # Date 995622027 0 # Node ID 08dafe901c44bdf706db95a099919458a4444f40 # Parent bd96796d6d4bdd8d752205da34e4088410d88aa1 (delete-trailing-whitespace): Save match data around looking-at. From Markus Rost . diff -r bd96796d6d4b -r 08dafe901c44 lisp/simple.el --- a/lisp/simple.el Fri Jul 20 09:35:17 2001 +0000 +++ b/lisp/simple.el Fri Jul 20 09:40:27 2001 +0000 @@ -239,8 +239,9 @@ (while (re-search-forward "\\s-$" nil t) (skip-syntax-backward "-" (save-excursion (forward-line 0) (point))) ;; Don't delete formfeeds, even if they are considered whitespace. - (if (looking-at ".*\f") - (goto-char (match-end 0))) + (save-match-data + (if (looking-at ".*\f") + (goto-char (match-end 0)))) (delete-region (point) (match-end 0)))))) (defun newline-and-indent ()