help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clear trailing whitespace on save, but not at the cursor


From: Juanma Barranquero
Subject: Re: Clear trailing whitespace on save, but not at the cursor
Date: Mon, 5 Mar 2012 16:07:51 +0100

On Mon, Mar 5, 2012 at 12:02, Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> (defadvice delete-trailing-whitespace
>  (around except-for-current-line activate)
>  "However, leave trailing whitespace before point alone."
>  (let ((save (when (looking-back "\\s-+" (line-beginning-position) t)
>                (match-string 0))))
>    ad-do-it
>    (when save (insert save))))

That does not answer to this part of the request:

> I'm wondering if it's possible to do it in
> such a way that if I save and then quit, it doesn't bug me about
> saving because it modified the file again with the new whitespace.

    Juanma



reply via email to

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