all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: seberino@spawar.navy.mil (Christian Seberino)
Subject: Re: How delete whitespace at END of file automatically when save and exit file?
Date: 25 Aug 2003 16:55:30 -0700	[thread overview]
Message-ID: <bf23f78f.0308251555.1dd14278@posting.google.com> (raw)
In-Reply-To: 8765kr995j.fsf@member.fsf.org

I tried your function and it worked!! Thanks! Very useful.

Chris


Jose A. Ortega Ruiz <jao@member.fsf.org> wrote in message news:<8765kr995j.fsf@member.fsf.org>...
> hi,
> 
> (defun my-delete-trailing-lines ()
>   (goto-char (point-max))
>   (delete-blank-lines))
> 
> (add-hook 'write-file-hooks 'my-delete-trailing-lines)
> 
> warning: untested :)
> 
> hth,
> jao
> 
> seberino@spawar.navy.mil (Christian Seberino) writes:
> 
> > delete-trailing-whitespace deletes whitespace at LEFT but not at
> > BOTTOM!? How do BOTTOM too?
> >
> >
> > In other words... if I have a bunch of newlines at the end, e.g.
> > \n\n\n\n\n
> >
> > ...How replace them with just one \n?
> >
> > chris

  parent reply	other threads:[~2003-08-25 23:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-20 22:52 How delete whitespace at END of file automatically when save and exit file? Christian Seberino
2003-08-20 23:55 ` Jose A. Ortega Ruiz
2003-08-21  6:39   ` Lute Kamstra
2003-08-25 23:55   ` Christian Seberino [this message]
2003-08-28 19:11   ` Christian Seberino
2003-08-29 14:51     ` Thien-Thi Nguyen

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

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

  git send-email \
    --in-reply-to=bf23f78f.0308251555.1dd14278@posting.google.com \
    --to=seberino@spawar.navy.mil \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.