[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs local variables sections in files; time-stamping
From: |
Eric Blake |
Subject: |
Re: Emacs local variables sections in files; time-stamping |
Date: |
Tue, 22 Feb 2011 16:38:48 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
On 02/22/2011 04:24 PM, Glenn Morris wrote:
> contain stuff like this:
>
> # Local Variables:
> # mode: shell-script
> # sh-indentation: 2
> # eval: (add-hook 'write-file-hooks 'time-stamp)
> # time-stamp-start: "scriptversion="
> # time-stamp-format: "%:y-%02m-%02d.%02H"
> # time-stamp-time-zone: "UTC"
> # time-stamp-end: "; # UTC"
> # End:
>
> Firstly, a minor point. write-file-hooks is obsolete since Emacs 22.1,
> replaced by write-file-functions. (Actually, the Emacs documentation
> suggests using before-save-hook for time-stamping.)
And what's the portable fallback, for files that might be maintained on
older emacs?
>
> Is it really necessary to have this setting in the files?
Do you have a suggestion for an alternate way to ensure that the
timestamps are consistently updated when edited in their primary
upstream repo, without the use of the eval? For example, would creating
a .dir-locals.el in the same repository do the trick? And, showing how
little I know about .dir-locals.el, what would its contents have to be
to take the place of the eval?
I'd welcome such a patch (well, probably multiple patches, since
upstream varies for some of the files in question), since I also don't
like the question every time I open the file, but do want the automatic
timestamp update to work any time I edit one of those files in their
primary upstream location.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature