About ads on Siafoo
Hide Siafoo is here to make coding less frustrating and to save you time. Learn More Join Siafoo

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
Lines 9
Owner: billalex
Viewable by Everyone
Editable by billalex's Friends
Sponsored Links
About ads on Siafoo