unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [RFC] trim.el -- Functions to delete extra whitespace
@ 2008-02-12 11:53 Jari Aalto
  2008-02-12 14:35 ` Dan Nicolaescu
  0 siblings, 1 reply; 6+ messages in thread
From: Jari Aalto @ 2008-02-12 11:53 UTC (permalink / raw)
  To: emacs-devel; +Cc: Sean MacLennan - trim.el


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.






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-17 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-12 11:53 [RFC] trim.el -- Functions to delete extra whitespace Jari Aalto
2008-02-12 14:35 ` Dan Nicolaescu
2008-02-16  3:50   ` Vinicius Jose Latorre
2008-02-17 13:22     ` Richard Stallman
2008-02-17 17:20       ` Vinicius Jose Latorre
2008-02-17 16:30     ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).