From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#347: C mode asks twice about local variables Date: Tue, 03 Jun 2008 02:40:29 -0400 Message-ID: References: <20080601172143.GA5899@muc.de> Reply-To: Stefan Monnier , 347@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212476847 3042 80.91.229.12 (3 Jun 2008 07:07:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2008 07:07:27 +0000 (UTC) Cc: bug-cc-mode@gnu.org, bug-gnu-emacs@gnu.org, 347@emacsbugs.donarmstrong.com To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 09:08:09 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K3Qcp-00008T-2m for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2008 09:08:07 +0200 Original-Received: from localhost ([127.0.0.1]:51529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3Qc2-0002FA-H6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Jun 2008 03:07:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3Qbw-0002F2-DF for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:07:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3Qbt-0002Eq-Tr for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:07:11 -0400 Original-Received: from [199.232.76.173] (port=38859 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3Qbt-0002En-OA for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:07:09 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:50536) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K3Qbt-0008Ff-4A for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:07:09 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3Qbr-0006c8-S9 for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2008 03:07:08 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m537746Q023736; Tue, 3 Jun 2008 00:07:05 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m536o5ww018522; Mon, 2 Jun 2008 23:50:05 -0700 X-Loop: don@donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 03 Jun 2008 06:50:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 347 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 347-submit@emacsbugs.donarmstrong.com id=B347.121247523917135 (code B ref 347); Tue, 03 Jun 2008 06:50:05 +0000 Original-Received: (at 347) by emacsbugs.donarmstrong.com; 3 Jun 2008 06:40:39 +0000 Original-Received: from ceviche.home (206-248-132-168.dsl.teksavvy.com [206.248.132.168]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m536eZbd017129 for <347@emacsbugs.donarmstrong.com>; Mon, 2 Jun 2008 23:40:36 -0700 Original-Received: by ceviche.home (Postfix, from userid 20848) id 856D4B423C; Tue, 3 Jun 2008 02:40:29 -0400 (EDT) In-Reply-To: <20080601172143.GA5899@muc.de> (Alan Mackenzie's message of "Sun, 1 Jun 2008 17:21:44 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Tue, 03 Jun 2008 03:07:11 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18228 Archived-At: > Yes. This needs fixing, somehow. > The way this happens is that in a C file's local variables list, there > are two "special" variables, e.g. `c-file-style'. > When > c-basic-offset: 11 > c-file-style: "k&r" > occurs in the local variable list, this triggers a hook function which > calls (c-set-style "k&r"). The hook is hack-local-variables-hook. The > problem is that this c-set-style call will overwrite the explicit value > for c-basic-offset. The explicit value MUST take precedence here. Can you try and call `c-file-style' with some extra "don't override" (when called from that hack-local-variables-hook) argument so that any variable that already has a buffer-local binding will not be overridden? > My solution was to call hack-local-variables a second time from within > the hook function, first having deleted any occurrences of `mode', > `c-file-style' etc. from the Local Variables. This kludge worked > reasonably well until the handling of safe/dangerous-local-variables was > changed for Emacs 22. How 'bout wrapping the call inside (let ((enable-local-variables :safe))? > If Emacs were not to rebind the do-you-want-to-apply-it variable inside > hack-local-variables, that would allow the kludge to work. I don't know what you're referring to here. Stefan