From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.bugs Subject: bug#7767: 23.2.91; file-local-variables-alist should have the permanent-local property Date: Sat, 1 Jan 2011 12:12:31 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1293857629 2840 80.91.229.12 (1 Jan 2011 04:53:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Jan 2011 04:53:49 +0000 (UTC) To: 7767@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 01 05:53:45 2011 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.69) (envelope-from ) id 1PYtTM-0000AO-Sm for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Jan 2011 05:53:45 +0100 Original-Received: from localhost ([127.0.0.1]:50696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYtTM-0001d9-Ia for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Dec 2010 23:53:44 -0500 Original-Received: from [140.186.70.92] (port=40420 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYtTF-0001bg-8Y for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:53:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYtTD-0001YO-ND for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:53:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYtTD-0001YI-Js for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:53:35 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PYtJ0-0001gu-Mm; Fri, 31 Dec 2010 23:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Harsanyi Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jan 2011 04:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.12938569526457 (code B ref -1); Sat, 01 Jan 2011 04:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jan 2011 04:42:32 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PYtIV-0001g5-78 for submit@debbugs.gnu.org; Fri, 31 Dec 2010 23:42:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PYsir-0000us-Ow for submit@debbugs.gnu.org; Fri, 31 Dec 2010 23:05:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYspd-0004a1-2S for submit@debbugs.gnu.org; Fri, 31 Dec 2010 23:12:42 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:47873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYspc-0004Zr-WD for submit@debbugs.gnu.org; Fri, 31 Dec 2010 23:12:41 -0500 Original-Received: from [140.186.70.92] (port=45851 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYspa-0004nd-CN for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:12:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYspY-0004ZD-Q3 for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:12:37 -0500 Original-Received: from outbound-mail02.westnet.com.au ([203.10.1.243]:51512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYspY-0004Z5-FA for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2010 23:12:36 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjQSAKs3Hk06B8wmPGdsb2JhbAAMiDGcDAEBAQE1vQiDEoI4BIRj X-IronPort-AV: E=Sophos;i="4.60,257,1291564800"; d="scan'208";a="120308438" Original-Received: from 58-7-204-38.dyn.iinet.net.au (HELO [10.0.1.3]) ([58.7.204.38]) by outbound-mail02.westnet.com.au with ESMTP/TLS/AES128-SHA; 01 Jan 2011 12:12:33 +0800 X-Mailer: Apple Mail (2.1082) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 31 Dec 2010 23:42:28 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 31 Dec 2010 23:43:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:42970 Archived-At: Here is a scenario that illustrates the problem. Save the following into a file named hello.cc: ---------- #include int main() { std::cout << "Hello World\n"; } /* Local Variables: mode: c++ compile-command: "g++ -o hello hello.cc" End: */ ---------- After visiting this file in Emacs, and typing M-x compile RET, I expect the default compilation command to be the one set in the local variables section of the file. Instead it is "make -k" which is the default one for the `compile-command' variable. I tried to debug the problem and it seems that `hack-local-variables' will collect the local variables into `file-local-variables-alist' than run the hook `before-hack-local-variables-hook' which containts the function `c-before-hack-hook'. `c-before-hack-hook' will see the `mode' variable and call `c++-mode' which than will call `kill-all-local-variables' setting `file-local-variables-alist' to nil so that the remaining variables are not processed. Adding the `permanent-local' property to `file-local-variables-alist' seems to fix the problem. Note that the problem does not seem too occur if the mode is set to 'c', but it does for 'c++' and 'python'. I'm not sure why this is. This happens both on the trunk and on the emacs-23 branch. In GNU Emacs 23.2.91.1 (x86_64-apple-darwin10.5.0, NS apple-appkit-1038.35) of 2010-12-31 on karinji-2.local Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: C++/l Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: C-x C-f ~ / P r o h e M-x c o m p i l e C-g M-x r e p o r t - e m C-g C-h f h a c k l o C-v C-v C-v C-v s-w M-w M-x Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Quit [2 times] Type C-x 1 to delete the help window. uncompressing files.el.gz...done Loading vc-bzr...done call-interactively: Attempt to delete the sole visible or iconified frame Load-path shadows: None found. Features: (shadow sort mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock hashcash mail-utils vc-bzr sha1 hex-util jka-compr find-func help-mode view help-fns emacsbug compile comint ring cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind ns multi-tty emacs)