[Top][All Lists]

[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: Mon, 13 Jul 2009 08:19:49 +0000
User-agent: Mutt/1.5.9i

Morning, Stephen!

On Mon, Jul 13, 2009 at 03:22:17PM +0900, Stephen J. Turnbull wrote:
> Miles Bader writes:
>  > Chong Yidong <address@hidden> writes:
>  > >> ! These settings can override those made by a user in his .emacs so
>  > >> ! you should be careful not to set variables which are a matter of
>  > >> ! personal choice.  You should probably not set @code{c-file-syle}
>  > >> ! and @code{c-file-offsets} here (@pxref{File Styles,,,ccmode}).

>  > > But I think we have a basic disagreement here.  A user should feel
>  > > free to set directory local variables that override his or her .emacs
>  > > settings---exactly like he or she should feel free to write file-local
>  > > variables.  The manual has no purpose telling people what to do with
>  > > their own files.

> I don't understand what you are saying.  The manual has done that
> forever!  There is specific advice *not* to set auto-fill mode in
> local variables, for example.

> And there is good reason for that.  Files are *not* "of the user".
> Files are a means of communication.  Sometimes indeed they are memos
> to oneself in the future, but more often they are for communicating
> with others.

> The issue Alan is raising is precisely that *somebody else* is
> overriding the user's settings.

Thank you!  That is EXACTLY what I'm raising.  What's more, the
overriding is surreptitious - it took Jan some time to find out what was
going wrong.  How do you turn off this .dir-locals.el thingy?

I agree with Miles:

>  > It also seems downright bizarre to tell people not to set
>  > c-file-style in .dir-settings.el -- my sense is that most developers
>  > would agree that if a project has C style conventions, they should
>  > override the user's personal preferences...

No.  They should act as a project wide default, which a user can
occasionally vary as he sees fit.  The problem is not that .dir-locals.el
exists, but that it takes precedence over a user's c-mode-hook, or a
top-level (setq c-cleanup-list) in .emacs.  Jan complained that he was
left with no way to set c-cleanup-list.  (M-: (setq ....) doesn't count
as "a way" here.)

> Indeed.  I think that needs to be sorted out here is Alan's intuition
> that C style conventions are a matter of personal preference.

Hey, that's not fair!

c-cleanup-list is partly project conventions (in that it can implement
formatting rules), partly personal preference (in that it enables
electric action in a C buffer).  For example, a project may specify the
'brace-else-brace' convention (see page "Clean-ups" in the CC Mode
manual), but a hacker may not want this to be done electrically in his

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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