From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: seberino@spawar.navy.mil (Christian Seberino) Newsgroups: gmane.emacs.help Subject: Re: How delete whitespace at END of file automatically when save and exit file? Date: 25 Aug 2003 16:55:30 -0700 Organization: http://groups.google.com/ Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <8765kr995j.fsf@member.fsf.org> NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1061862935 15630 80.91.224.253 (26 Aug 2003 01:55:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Aug 2003 01:55:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 26 03:55:33 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19rT3V-0000wz-00 for ; Tue, 26 Aug 2003 03:55:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19rSv8-0001Rq-Oa for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Aug 2003 21:46:54 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 198.253.72.211 Original-X-Trace: posting.google.com 1061855731 25304 127.0.0.1 (25 Aug 2003 23:55:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: 25 Aug 2003 23:55:31 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:116140 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12058 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12058 I tried your function and it worked!! Thanks! Very useful. Chris Jose A. Ortega Ruiz 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