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: Jose A . Ortega Ruiz
Subject: Re: How delete whitespace at END of file automatically when save and exit file?
Date: Thu, 21 Aug 2003 01:55:20 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

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

address@hidden (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)


reply via email to

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