From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation Date: Thu, 02 Jun 2011 10:35:50 -0300 Message-ID: References: <87pqngewwp.fsf@spindle.srvr.nix> <87wrh5tyh7.fsf@spindle.srvr.nix> <20110602122412.GA2448@acm.acm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1307023897 7213 80.91.229.12 (2 Jun 2011 14:11:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2011 14:11:37 +0000 (UTC) Cc: Nix , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 02 16:11:33 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QS8cX-0000Io-0Y for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2011 16:11:33 +0200 Original-Received: from localhost ([::1]:35757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS8cV-0007MI-Ks for ged-emacs-devel@m.gmane.org; Thu, 02 Jun 2011 10:11:31 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:32940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS844-0007Cd-63 for emacs-devel@gnu.org; Thu, 02 Jun 2011 09:35:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS842-0001rE-9Q for emacs-devel@gnu.org; Thu, 02 Jun 2011 09:35:55 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:42112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS841-0001r2-L9 for emacs-devel@gnu.org; Thu, 02 Jun 2011 09:35:53 -0400 Original-Received: from 121-249-126-200.fibertel.com.ar ([200.126.249.121]:17906 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QS841-0007W7-Ak; Thu, 02 Jun 2011 09:35:53 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3AFAE6635F; Thu, 2 Jun 2011 10:35:50 -0300 (ART) In-Reply-To: <20110602122412.GA2448@acm.acm> (Alan Mackenzie's message of "Thu, 2 Jun 2011 12:24:12 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140065 Archived-At: > I agree with Stefan, the whole business of initialising style variables > has passed the level of complexity at which humans can handle it. IMAO, > the straw that broke the camel's back was the misuse of `c-file-style' in > .dir-locals (for which I accept I'm mostly to blame). Before any other > ways of simplification are explored, this use of `c-file-style' needs to > be separated from the normal use, possibly by something like this in the > Emacs core: > (if (and (boundp 'c-file-style) > c-file-style) > (setq c-dir-style c-file-style > c-file-style nil)) > Then CC Mode could get rid of all the attempted hacks for handling the > hybrid `c-file-style'. I'd rather not hardcode such CC-mode-specific code in Emacs core, but maybe we can provide a generic way to do that or something similar. The direct way to do the above would be for Emacs to provide a "dir-locals-redirect" property which you could set on c-file-style, redirecting it to c-dir-style. Or maybe it would be enough to provide both the list of file-local and the list of dir-local variables, so that CC-mode could tell whether c-file-style was set file-locally, or dir-locally, or some other way. Stefan