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: Lute Kamstra
Subject: Re: How delete whitespace at END of file automatically when save and exit file?
Date: Thu, 21 Aug 2003 08:39:45 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Jose A. Ortega Ruiz <address@hidden> writes:

> (defun my-delete-trailing-lines ()
>   (goto-char (point-max))
>   (delete-blank-lines))
>
> (add-hook 'write-file-hooks 'my-delete-trailing-lines)

In addition,

(setq next-line-add-newlines nil)

helps to prevent inserting empty lines at the end of files.

  Lute

-- 
(spook) => "Compsec USDOJ CIDA"
(insert-file-contents "~/.signature") => (error "`~/.signature' too rude")


reply via email to

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