help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How delete whitespace at END of file automatically when save and exi


From: 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

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


reply via email to

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