From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Blunderbuss ".dir-locals.el" raises everything in its path!! Date: Sun, 12 Jul 2009 21:39:09 +0000 Message-ID: <20090712213909.GC1009@muc.de> References: <20090712144137.GB2524@muc.de> <87hbxhony6.fsf@stupidchicken.com> <20090712180623.GA1009@muc.de> <4A5A2BE1.3050206@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247436252 6122 80.91.229.12 (12 Jul 2009 22:04:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2009 22:04:12 +0000 (UTC) Cc: Chong Yidong , Jan =?iso-8859-1?Q?Dj=E4rv?= , emacs-devel@gnu.org To: David De La Harpe Golden Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 13 00:04:04 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MQ79Q-0001Mf-8g for ged-emacs-devel@m.gmane.org; Mon, 13 Jul 2009 00:04:04 +0200 Original-Received: from localhost ([127.0.0.1]:60809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQ79P-00021y-Hr for ged-emacs-devel@m.gmane.org; Sun, 12 Jul 2009 18:04:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQ79L-00021f-8s for emacs-devel@gnu.org; Sun, 12 Jul 2009 18:03:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQ79G-00021T-Oy for emacs-devel@gnu.org; Sun, 12 Jul 2009 18:03:58 -0400 Original-Received: from [199.232.76.173] (port=58281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQ79G-00021Q-KD for emacs-devel@gnu.org; Sun, 12 Jul 2009 18:03:54 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:3135 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MQ79F-0002qo-SL for emacs-devel@gnu.org; Sun, 12 Jul 2009 18:03:54 -0400 Original-Received: (qmail 21938 invoked by uid 3782); 12 Jul 2009 21:37:11 -0000 Original-Received: from acm.muc.de (pD9E539F5.dip.t-dialin.net [217.229.57.245]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Jul 2009 23:37:08 +0200 Original-Received: (qmail 4091 invoked by uid 1000); 12 Jul 2009 21:39:09 -0000 Content-Disposition: inline In-Reply-To: <4A5A2BE1.3050206@harpegolden.net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:112382 Archived-At: Hi, David! On Sun, Jul 12, 2009 at 07:30:57PM +0100, David De La Harpe Golden wrote: > Alan Mackenzie wrote: > >Yes, we both agree on what is happening. My point is that the > >contents of .dir-locals.el should not override explicit values given > >by the user in his .emacs. > Sorry, but isn't the point of .dir-locals.el to override settings on a > project tree specific basis, like file locals only for whole directory > trees? Wouldn't it'd be weird if .emacs "won" ? Please have a look at Jan's bug#3808 to see the exact problem he hit. One of the more subtle problems of CC Mode is that it "styles" contain preferences as well as settings. I find myself opposed to the .dir-locals.el mechanism. Unlike the file local variables mechanism, which is used for a definite purpose and is under the control of the hacker editing the file, .dir-locals.el takes control away from hackers, it's surreptitious (ls won't list it unless you give it -a, and often it's not even in the same directory), and it tends to lead hackers on a frustrating, time wasting search for why their Emacs is doing strange things, as it just has done for Jan. Kudos to Jan for taking the time and trouble to track the problem down. I think project settings would be better done in the traditional manner by putting lisp functions into major mode hooks. Both require elisp skills after all, so I can't really see what .dir-locals.el saves. > I mean, I can see that yes, one might ALSO want a different kind of > .dir-local.el or file-local setting that doesn't (In the common lisp > case that could be handled by defvar vs. defparameter, say...) AARRRGGGGHHHH!!! As if we don't don't have enough complexity as it is. > (The thing that irritates me about dir-locals is their syntactic > incompatiblity with file-locals. If I want to promote a file local > I've been setting on a bunch of files to directory local, AFAIK I need > to rejig the syntax.) I'm not convinced this is a bad thing. They're utterly different things, even though their implementation is almost the same. File locals are an exquisite precision weapon. Dir locals are a blunderbuss. -- Alan Mackenzie (Nuremberg, Germany).