[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
Re: How delete whitespace at END of file automatically when save and exit file?
28 Aug 2003 12:11:38 -0700
Don't you have to add (delete-trailing-whitespace) to
I made a version based on yours that is almost perfect...
(defun cs-delete-trailing-whitespace() (interactive)
(let ((original-pos (point)))
(add-hook 'write-file-hooks 'cs-delete-trailing-whitespace)
For some reason these additions make me unable to do save-buffer!!!
I can't do M-x save-buffer anymore!!
M-x save-buffers-kill-emacs still works for some reason.
Jose A. Ortega Ruiz <address@hidden> wrote in message news:<address@hidden>...
> (defun my-delete-trailing-lines ()
> (goto-char (point-max))
> (add-hook 'write-file-hooks 'my-delete-trailing-lines)
> warning: untested :)
> 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