Hide
Know what you're getting – Unlike many sites, all our code is clearly licensed. Join Siafoo Now or Learn More

clean whitespace in text file: tabs become spaces, trailing blanks removed Atom Feed 0

In Brief Clean up whitespace in a text file. converts tabs to spaces removes trailing whitespace
# 's
 1;; written in eLisp:
2
3(defun ba-text-whitespace-cleanup ()
4 "Untabify and delete trailing whitespace in a buffer"
5 (interactive)
6 (save-excursion
7 (untabify (point-min) (point-max))
8 (goto-char (point-min))
9 (while (search-forward-regexp "[ \t]+$" nil t)
10 (replace-match ""))))
Clean up whitespace in a text file.
converts tabs to spaces removes trailing whitespace