emacs-devel
[Top][All Lists]
Advanced

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

Re: Blunderbuss ".dir-locals.el" raises everything in its path!!


From: Juri Linkov
Subject: Re: Blunderbuss ".dir-locals.el" raises everything in its path!!
Date: Fri, 17 Jul 2009 12:42:57 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>>> If the variable is set in both, we should be careful to say it's
>>> "file-local" and not "dir-local".
>
>> Sorry, I don't understand.  If the variable is set in both
>> `file-local-variables-alist' and `(dir-local-variables-alist)',
>> then it's "dir-local" and not "file-local".
>
> No, if it's set both in dir-locals.el and in file-local, then it's
> file-local.

IIUC, there are three possible cases:

1. if it's set in file-local but not in dir-locals.el
   then (variable . value) is stored in `file-local-variables-alist'
   but not in `dir-local-variables-alist'

2. if it's set in dir-locals.el but not in file-local
   then (variable . value) is stored both in `file-local-variables-alist'
   and in `dir-local-variables-alist'

3. if it's set both in file-local and in dir-locals.el
   then (variable . value) is stored both in `file-local-variables-alist'
   and in `dir-local-variables-alist'

The problem is that the 3rd case doesn't seem correct.  I think we should
fix `hack-local-variables-filter' to remove (variable . value) from
`dir-local-variables-alist' when it comes from file-locals and thus
overrides dir-locals.

So the 3rd case will be:

3. if it's set both in file-local and in dir-locals.el
   then (variable . value) is stored in `file-local-variables-alist'
   but not in `dir-local-variables-alist'

I could implement this with adding a new variable `dir-local-variables-alist'
after Yidong installs his patch in the same part of code that removes
duplicates from `file-local-variables-alist'.

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




reply via email to

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