emacs-devel
[Top][All Lists]
Advanced

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

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


From: Alan Mackenzie
Subject: Blunderbuss ".dir-locals.el" raises everything in its path!!
Date: Sun, 12 Jul 2009 14:41:37 +0000
User-agent: Mutt/1.5.9i

Hi, Emacs!

IMAO, the ".dir-locals.el" facility needs fixing.  It is a blunderbuss
weapon of mass destruction, totally sweeping away careful, well
considered, delicately crafted settings made by hackers in other ways.

In particular, it hit Jan Djärv, see:
    bug#3808: 23.1.50; CC-mode: Impossible to set c-cleanup-list.

He set `c-cleanup-list' in his .emacs, but this was obliterated by the

    (c-mode . ((c-file-style . "GNU")))

line in .dir-locals.el.

Ladies and Gentleman, `c-file-style' is for use ONLY in a local variable
list at the end of a file.  This is even documented.  OK, it's only
documented in the CC Mode manual, not the doc string.  `c-file-style'
has the effect of setting lots of CC Mode config stuff, but when it's a
a file local variable list, the hacker can override these implicit
settings with her own explicit ones.

I wasn't aware of .dir-locals.el until today, which is my fault.  But it
seems like a facility thrown in without being properly thought through.
Its settings take priority over everything else, including the user's
hooks, top level setq's, etc.  This is suboptimal in the extreme.

Surely .dir-locals.el should, in some fashion, supply defaults which may
be overridden by mode hooks and the like.  It is almost, but not quite,
entirely unlike file local settings, a rarely used precision instrument.

To emphasise: this thing has caused a real problem to a pretester.  It
needs fixing.

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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