clean whitespace in text file: tabs become spaces, trailing blanks removed
In Brief:
Clean up whitespace in a text file.
converts tabs to spaces
removes trailing whitespace
Language
Text only
# '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
Add a Comment