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: Tue, 14 Jul 2009 16:22:06 +0000 Message-ID: <20090714162206.GC1718@muc.de> References: <20090712144137.GB2524@muc.de> <87hbxhony6.fsf@stupidchicken.com> <20090712180623.GA1009@muc.de> <87k52dycha.fsf@stupidchicken.com> <4A5AC184.5050805@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247588428 10323 80.91.229.12 (14 Jul 2009 16:20:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jul 2009 16:20:28 +0000 (UTC) Cc: Chong Yidong , Jan =?iso-8859-1?Q?Dj=E4rv?= , Stefan Monnier , emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 14 18:20:20 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 1MQkjr-0004ux-La for ged-emacs-devel@m.gmane.org; Tue, 14 Jul 2009 18:20:19 +0200 Original-Received: from localhost ([127.0.0.1]:45232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQkjq-0002GA-RA for ged-emacs-devel@m.gmane.org; Tue, 14 Jul 2009 12:20:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQkjk-0002Fq-C9 for emacs-devel@gnu.org; Tue, 14 Jul 2009 12:20:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQkjh-0002DN-10 for emacs-devel@gnu.org; Tue, 14 Jul 2009 12:20:12 -0400 Original-Received: from [199.232.76.173] (port=55213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQkjg-0002DB-NN for emacs-devel@gnu.org; Tue, 14 Jul 2009 12:20:08 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:3272 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 1MQkjg-0000WQ-6w for emacs-devel@gnu.org; Tue, 14 Jul 2009 12:20:08 -0400 Original-Received: (qmail 97982 invoked by uid 3782); 14 Jul 2009 16:20:06 -0000 Original-Received: from acm.muc.de (pD9E23B21.dip.t-dialin.net [217.226.59.33]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 14 Jul 2009 18:20:03 +0200 Original-Received: (qmail 3012 invoked by uid 1000); 14 Jul 2009 16:22:06 -0000 Content-Disposition: inline In-Reply-To: <4A5AC184.5050805@gnu.org> 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:112454 Archived-At: 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).