Browse › Snippets › Text only › clean whitespace in text file: tabs become spaces, trailing blanks removed
Solve a problem – Filter by language, license, keyword, owner, or search text to find code & info fast.
Updated over 9 years ago (19 Aug 2008 at 11:04 AM) recent activity
|In Brief||Clean up whitespace in a text file. converts tabs to spaces removes trailing whitespace|
1;; written in eLisp:
3(defun ba-text-whitespace-cleanup ()
4 "Untabify and delete trailing whitespace in a buffer"
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