]> git.eshelyaron.com Git - emacs.git/commitdiff
(delete-trailing-whitespace): Save match data
authorGerd Moellmann <gerd@gnu.org>
Fri, 20 Jul 2001 09:40:27 +0000 (09:40 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 20 Jul 2001 09:40:27 +0000 (09:40 +0000)
around looking-at.  From Markus Rost <rost@math.ohio-state.edu>.

lisp/simple.el

index dec66469c107e5641a523661170ade68216d9a31..51887986f60e425ea5fa4e8301923915b3206974 100644 (file)
@@ -239,8 +239,9 @@ A formfeed is not considered whitespace by this function."
       (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 ()