unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jari Aalto <jari.aalto@cante.net>
To: emacs-devel@gnu.org
Cc: "Sean MacLennan - trim.el" <xemacs@seanm.ca>
Subject: [RFC] trim.el -- Functions to delete extra whitespace
Date: Tue, 12 Feb 2008 13:53:41 +0200	[thread overview]
Message-ID: <d4r2mlve.fsf@blue.sea.net> (raw)


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	other threads:[~2008-02-12 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 11:53 Jari Aalto [this message]
2008-02-12 14:35 ` [RFC] trim.el -- Functions to delete extra whitespace 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4r2mlve.fsf@blue.sea.net \
    --to=jari.aalto@cante.net \
    --cc=emacs-devel@gnu.org \
    --cc=xemacs@seanm.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).