Commit 661aa5c7 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(delete-trailing-whitespace): Save match data

around looking-at.  From Markus Rost <>.
parent c296fc01
......@@ -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)))
(if (looking-at ".*\f")
(goto-char (match-end 0))))
(delete-region (point) (match-end 0))))))
(defun newline-and-indent ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment