emacs-devel
[Top][All Lists]
Advanced

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

Re: Add file-locals and dir-locals


From: Leo
Subject: Re: Add file-locals and dir-locals
Date: Wed, 22 Jul 2009 04:49:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2009-07-22 01:21 +0100, Juri Linkov wrote:
>>> Below is the final patch that I find useful enough to commit. I invite
>>> you and other developers to improve this further as you wish.
>>
>> Does this patch support adding local variables both in the beginning and
>> end of buffers?
>>
>> I'd love to see this applied in trunk so that it can easily tested.
>> Thanks for the patch.
>
> Right, adding local variables to the first line is necessary too.
> This requires designing a good UI for that. 

I forgot to mention in the last post that there is also directory-local
variables, which I think should also be supported. But we can get
support for file local variables first and worry about that later.

> One idea is after executing `M-x add-file-local-variable RET' ask a
> question like:
>
>   Add variable to the beginning or end of buffer (yes or no)
>
> which obviously always implies "yes".  The problem that the prompt should
> mention both alternatives, but yes-or-no-p accepts only "y" or "n".
> Using `map-y-or-n-p' to accept other keys will complicate the prompt.
> Do you have any better idea?

I'd prefer the default to add to the end of a buffer, because file local
variables at the end of a file is more difficult to get right manually.

With one C-u, add to the header

With two C-u, add to .dir-locals.el

Another approach is to give the user a list to select:

 1. head 2. foot 3. dir

-- 
Leo's Emacs uptime: 41 days, 13 hours, 58 minutes, 31 seconds





reply via email to

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