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: Alan Mackenzie
Subject: Re: Blunderbuss ".dir-locals.el" raises everything in its path!!
Date: Tue, 14 Jul 2009 16:22:06 +0000
User-agent: Mutt/1.5.9i

Hi, Jason, Jan, Stefan!

On Mon, Jul 13, 2009 at 01:09:24PM +0800, Jason Rumney wrote:
> Chong Yidong wrote:
> >This indicates that we should not set c-file-style in the .dir-locals.el
> >file of the Emacs source tree.

> I think it points to a bug in the handling of c-file-style.  The 
> documentation of c-cleanup-list (which is the variable that Jan was 
> surprised about) says that it should only be affected by the style when 
> it is set to set-from-style.

I think you're right here, and that the bug is that the function handling
c-file-style forgets to check that its value is 'set-from-style.  The
complexity of all the interacting features is far too high IMAO, and my
brain is right at the limits of what it can grasp; even though I'm
currently the custodian for a great deal of this complexity.

I've thought a lot about this, and think I now understand the problem.
The CC Mode manual (on page "Config Basics") lists the various ways of
setting a style variable in order of precedence, like this:

      If you make conflicting settings in several of these ways, the way
    that takes precedence is the one that appears latest in this list:

        Style
        Top-level command or "customization interface"
        Hook
        File Style

I confused myself by pompous language.  If instead of "If you make
conflicting settings ..." I had written "If you set a style variable in
several of these ways ...", I don't think I would have got this feature
wrong.

However, this fails to mention directly setting a style variable in the
Local Variables section, or to distinguish that from a File Style.  The
list, perhaps, should look like this, with the code being change
accordingly:

        Style
        File Style                  <-------------
        Top-level command or "customization interface"
        Hook
        File local variable setting <-------------

As I say, I'm not totally unconfused about all this at the moment, but
I'm confident that you (Jason) have identified the problem.

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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