changeset 38498:08dafe901c44

(delete-trailing-whitespace): Save match data around looking-at. From Markus Rost <rost@math.ohio-state.edu>.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 20 Jul 2001 09:40:27 +0000
parents bd96796d6d4b
children a4baa9de015f
files lisp/simple.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 ()