emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] trim.el -- Functions to delete extra whitespace


From: Jari Aalto
Subject: [RFC] trim.el -- Functions to delete extra whitespace
Date: Tue, 12 Feb 2008 13:53:41 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt)

I'd lke to suggest adding trim.el to the distribution. It provides
handy functions to fix buffer's/region's whitespace problems.

The code is GPL

Jari

    http://xemacs.seanm.ca/lisp/trim.el

-----------------------------------------------------------------------

trim                                    Function:
Searches for `regexp' and deletes any matches.
If optional arg `replace' is set, it replaces the match.
If the region is active, only trims the lines in the region.

trim-lines                              Function:
Trim whitespace (including CR) from the ends of all lines.
If the region is active, only trims the lines in the region.

trim-empty-lines                        Function:
Trim all empty lines.
An empty line is a line with only whitespace (space, tab, CR) characters.
If the region is active, only trims the lines in the region.

trim-spaces                             Function:
Trim all sequences of spaces to one space.
If the region is active, only trims the lines in the region.

trim-leading-spaces                     Function:
Trim all white space at the starts of lines.
If the region is active, only trims the lines in the region.

trim-defines                            Function:
Trim `#define' lines to isolate the `identifier'.
If the region is active, only trims the lines in the region.

untrim-lines                            Function:
Add ^M to the end of all lines.
If the region is active, only untrims the lines in the region.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]