From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jose A. Ortega Ruiz Newsgroups: gmane.emacs.help Subject: Re: How delete whitespace at END of file automatically when save and exit file? Date: Thu, 21 Aug 2003 01:55:20 +0200 Organization: Using Debian GNU/Linux Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <8765kr995j.fsf@member.fsf.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1061431171 461 80.91.224.253 (21 Aug 2003 01:59:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2003 01:59:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 21 03:59:30 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 19peja-0005OG-00 for ; Thu, 21 Aug 2003 03:59:30 +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 19pd5j-0002VQ-4m for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Aug 2003 20:14:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!103.red-80-33-152.pooles.rima-tde.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 103.red-80-33-152.pooles.rima-tde.net (80.33.152.103) Original-X-Trace: news.uni-berlin.de 1061423720 4353951 80.33.152.103 (16 [172394]) User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-Face: E>a8 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:11942 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11942 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 -- An eye for an eye leaves everyone blind. -Mohandas Karamchand Gandhi (1869-1948)