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, 05 Aug 2009 02:57:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2009-08-05 00:59 +0100, Juri Linkov wrote:
[...]
>> 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
>
> This requires from the user leaning and remembering how many C-u to
> type.

On a second thought, this is indeed pretty bad.

>> Another approach is to give the user a list to select:
>>
>>  1. head 2. foot 3. dir
>
> This is not convenient to use.
>
> Meanwhile I implemented new commands `add-file-local-variable-prop-line'
> and `delete-file-local-variable-prop-line'.  The suffix `-prop-line'
> is by analogy with the pair of functions `hack-local-variables' and
> `hack-local-variables-prop-line'.
>
> As not frequently used commands, it's not difficult for the user to
> select the necessary command using completions for M-x:
>
> M-x add-file-local-variable RET
> M-x add-file-local-variable-prop-line RET
> M-x add-dir-local-variable RET
>
> Please try these commands and tell what do you think.

I have tried these commands briefly and they seem to work fine.

For the first two commands, if they are called interactively, do you
think the file variables should be evaled after being added?

-- 
Leo's Emacs uptime: 1 day, 1 hour, 48 minutes, 43 seconds





reply via email to

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