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: Juri Linkov
Subject: Re: Add file-locals and dir-locals
Date: Thu, 06 Aug 2009 23:36:23 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>>> For the first two commands, if they are called interactively, do you
>>> think the file variables should be evaled after being added?
>>
>> Interesting question. Formally speaking, evaluating them seems right
>> to keep local variables consistent with real values in the current
>> buffer.
>>
>> But such evaluation requires also executing all safety mechanisms that
>> also may ask a question whether a variable is safe.
>
> By executing all safety mechanisms, do you mean calling
> `hack-local-variables' or `hack-local-variables-prop-line'?

Yes, these and `hack-local-variables-confirm'.

> The question whether a variable is safe or not will be asked anyway
> i.e.  the next time the file is opened. And it is probably better be
> asked when it is added since at this time the user has better idea
> what to do with it.

The value is not applied and the question is not asked when the user
manually types the settings in the Local Variables section.  New commands
are just more convenient way to do the same.  So I think applying the
value immediately would be unexpected for users.

Another reason not to apply settings immediately are commands that
delete local variables: delete-file-local-variable(-prop-line) and
delete-dir-local-variable.  For consistency it would be logical
for these commands to unset the value after deleting the corresponding
setting from local variables.  But what is the value to revert
the variable after deleting its value to?  nil?  Some of previous
old values?  There is no certain answer.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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