Re: [PATCH] Trim trailing whitespace in vim and emacs - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: [PATCH] Trim trailing whitespace in vim and emacs
Date
Msg-id 87y3ftvsi1.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: [PATCH] Trim trailing whitespace in vim and emacs  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
>>>>> "Peter" == Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

 >> +            (lambda () (add-to-list 'write-file-functions 'delete-trailing-whitespace)))))

 Peter> dir-locals doesn't work this way.  It's not a general lisp file.

Right. The correct approach is

+       (eval add-hook 'before-save-hook 'delete-trailing-whitespace nil t)))

(see the value of safe-local-eval-forms for why)

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: Periods
Next
From: Andrew Gierth
Date:
Subject: Re: [PATCH] Trim trailing whitespace in vim and emacs