10,16c10,13 < (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. < (save-match-data < (if (looking-at ".*\f") < (goto-char (match-end 0)))) < (delete-region (point) (match-end 0)))))) --- > (let ((count 0)) > (while (re-search-forward "[ \t\r]+$" nil t) > (replace-match "")(setq count (1+ count))) > (message "Cleaned %d lines" count)))))