From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Apr 2016 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23407@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146201212129803 (code B ref -1); Sat, 30 Apr 2016 10:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Apr 2016 10:28:41 +0000 Received: from localhost ([127.0.0.1]:56394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awS8f-0007kd-KX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awS8e-0007kO-3F for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awS8O-000833-VX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS8O-00081z-TX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS8D-0002zl-7N for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awS7x-0007uW-Fl for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:28:05 -0400 Received: from mail.muc.de ([193.149.48.3]:40318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS7x-0007rT-6f for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:27:57 -0400 Received: (qmail 41797 invoked by uid 3782); 30 Apr 2016 10:27:46 -0000 Received: from acm.muc.de (p5B146848.dip0.t-ipconnect.de [91.20.104.72]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Apr 2016 12:27:45 +0200 Received: (qmail 4700 invoked by uid 1000); 30 Apr 2016 10:27:44 -0000 Date: Sat, 30 Apr 2016 10:27:44 +0000 Message-ID: <20160430102744.GA4644@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Hello, Emacs. In the master branch (I'm sure it's the same in the emacs-25 branch, too): 1. start Emacs with emacs -Q 2. Visit any emacs lisp file which is part of Emacs with C-x C-f. 3. Do C-h C-v indent-tabs-mode . The *Help* buffer starts off with: indent-tabs-mode is a variable defined in `C source code'. Its value is nil Original value was t Local in buffer follow.el; global value is t . The local value comes from the .dir-locals in the top level Emacs directory. 4. Do M-x emacs-lisp-mode. 5. Again do C-h C-v indent-tabs-mode . This time, the *Help* buffer starts off with: indent-tabs-mode is a variable defined in `C source code'. Its value is t . This is different from the first *Help* buffer. 6. This is a bug. On running a major mode, directory local settings should be respected. -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Apr 2016 10:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie , 23407@debbugs.gnu.org Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146201362332055 (code B ref 23407); Sat, 30 Apr 2016 10:54:02 +0000 Received: (at 23407) by debbugs.gnu.org; 30 Apr 2016 10:53:43 +0000 Received: from localhost ([127.0.0.1]:56403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awSWs-0008Kx-W2 for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:53:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awSWr-0008Kl-HC for 23407@debbugs.gnu.org; Sat, 30 Apr 2016 06:53:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id r12so9761272wme.0 for <23407@debbugs.gnu.org>; Sat, 30 Apr 2016 03:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=hQMDD4tjVnvnd70u/QKm4zDzy5yiiKFRHY2siTMA8t8=; b=bxZOaBelPNj24eBXe7lfK2UWkOCalgfDEGZwxTVgJPuH7HMeTcqzyGAmQc/KVaAxLj MCMF/PnYPFBjO5mFZAHG3yW5lEGihiWPe4FN3y+Hgijw415f5CW+JUIT34t/uIjemjrz gMVN/Yzeg8eAzTWjixzO1scIOtqNlWzuZczxMQDO1IbkRGV0Yy2KvqefqGcUrKwdMoGI ZfGT6AMvNtLfmfM/EKW/BJzCJgdYdF8YcZjLBKfu/k0cEKuvDIVY3bjZzb4BNJ8Uh0TE FXMyProiN25FjP0M9M+WLxJulczqclNvSsTLdYd6ajo8ZsAh15NMFlNHCnw3mw5RW4/S V+Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=hQMDD4tjVnvnd70u/QKm4zDzy5yiiKFRHY2siTMA8t8=; b=bOlHEWMt4Lli0qkdlytt3FlOVzj3DY0BYslSJpcQeDJCsQSkcAg4mAdop/+RG9oEYR xKq+4LL2+3Q8w2gB4K3M4gceYX3TpRl21Q1MZQYruMEZ6i98p1YZbdbdtRb1Uro7G60s lt5M911Fi/D3E5pg6bvw7m++M5M/nvS7YnzKsQgyWIqCOkIaaIKLdMUTFprr6uknxcvE lzryaKpiwMZDIcE4BJumil4mH3UunHiL5gj4sQ9blcU/4ewymnCY7ELmbUad5RceVCNL LTYFB6oqJAxhfUonGK5NSfrGgVUJyR91NAZWcNiR8FqTSXsABnmlYoqIcz009mCNdX+u tBRw== X-Gm-Message-State: AOPr4FXCyi+WFz0W4rxFlOHyHfetNVfCX30IG5HP/Pu4xg574YUYyvqJ3Nkfyhxe7c16Lg== X-Received: by 10.194.248.135 with SMTP id ym7mr26757815wjc.174.1462013615906; Sat, 30 Apr 2016 03:53:35 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id jd4sm18770187wjb.43.2016.04.30.03.53.34 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Apr 2016 03:53:35 -0700 (PDT) References: <20160430102744.GA4644@acm.fritz.box> From: Dmitry Gutov Message-ID: <439e6745-a762-e6b7-b7f0-690ba2a5eda2@yandex.ru> Date: Sat, 30 Apr 2016 13:53:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1 MIME-Version: 1.0 In-Reply-To: <20160430102744.GA4644@acm.fritz.box> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 04/30/2016 01:27 PM, Alan Mackenzie wrote: > 4. Do M-x emacs-lisp-mode. > 5. Again do C-h C-v indent-tabs-mode . This time, the *Help* > buffer starts off with: > > indent-tabs-mode is a variable defined in `C source code'. > Its value is t > > . This is different from the first *Help* buffer. I can see this too, in emacs-25. From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Apr 2016 18:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 23407@debbugs.gnu.org Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146204224514099 (code B ref 23407); Sat, 30 Apr 2016 18:51:02 +0000 Received: (at 23407) by debbugs.gnu.org; 30 Apr 2016 18:50:45 +0000 Received: from localhost ([127.0.0.1]:58389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awZyW-0003fL-Oc for submit@debbugs.gnu.org; Sat, 30 Apr 2016 14:50:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awZyU-0003f5-Sk for 23407@debbugs.gnu.org; Sat, 30 Apr 2016 14:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awZyG-00037t-8t for 23407@debbugs.gnu.org; Sat, 30 Apr 2016 14:50:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awZy3-00032t-CH; Sat, 30 Apr 2016 14:50:15 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1awZxw-0005hz-AZ; Sat, 30 Apr 2016 14:50:08 -0400 From: Glenn Morris References: <20160430102744.GA4644@acm.fritz.box> X-Spook: Plague Drug Enforcement Agency cryptographic Emergency X-Ran: niy6:p-)uqFUr\j!g0^Lxwd`7(>~TLueBG3zfr/l67Wm`YzjWQ (Alan Mackenzie's message of "Sat, 30 Apr 2016 10:27:44 +0000") Message-ID: <0joa8rszhb.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) It's the same with file-local variables, and it always has been. I don't think this is a bug. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 30 14:52:52 2016 Received: (at control) by debbugs.gnu.org; 30 Apr 2016 18:52:52 +0000 Received: from localhost ([127.0.0.1]:58397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awa0a-0003it-9N for submit@debbugs.gnu.org; Sat, 30 Apr 2016 14:52:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awa0Z-0003ic-33 for control@debbugs.gnu.org; Sat, 30 Apr 2016 14:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awa0K-0003qB-PR for control@debbugs.gnu.org; Sat, 30 Apr 2016 14:52:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awa0K-0003pK-Lq for control@debbugs.gnu.org; Sat, 30 Apr 2016 14:52:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1awa0G-00060x-1u for control@debbugs.gnu.org; Sat, 30 Apr 2016 14:52:32 -0400 Subject: control message for bug 23407 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Sat, 30 Apr 2016 14:52:32 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) merge 15577 23407 From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Apr 2016 18:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 23407@debbugs.gnu.org Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146204242014437 (code B ref 23407); Sat, 30 Apr 2016 18:54:02 +0000 Received: (at 23407) by debbugs.gnu.org; 30 Apr 2016 18:53:40 +0000 Received: from localhost ([127.0.0.1]:58401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awa1L-0003kn-HS for submit@debbugs.gnu.org; Sat, 30 Apr 2016 14:53:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awa1K-0003kX-0P for 23407@debbugs.gnu.org; Sat, 30 Apr 2016 14:53:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awa15-00043w-SP for 23407@debbugs.gnu.org; Sat, 30 Apr 2016 14:53:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awa0v-000408-PG; Sat, 30 Apr 2016 14:53:13 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1awa0p-00064J-RX; Sat, 30 Apr 2016 14:53:07 -0400 From: Glenn Morris References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> X-Spook: counter terrorism Pandemic Disaster assistance Los Zetas X-Ran: +~SW[5XqKyDSAH[=QPt`mX)KMIv"Lc{Faz>C:N2cwlfzW.K%oLVt,;eE.BU4R)I`i?|@/S X-Hue: white X-Attribution: GM Date: Sat, 30 Apr 2016 14:53:07 -0400 In-Reply-To: <0joa8rszhb.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sat, 30 Apr 2016 14:50:08 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) PS dupe of http://debbugs.gnu.org/15577 From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 May 2016 21:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: yary , 23407@debbugs.gnu.org, Stefan Monnier , Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146213813214880 (code B ref 23407); Sun, 01 May 2016 21:29:01 +0000 Received: (at 23407) by debbugs.gnu.org; 1 May 2016 21:28:52 +0000 Received: from localhost ([127.0.0.1]:32881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awyv6-0003rw-DL for submit@debbugs.gnu.org; Sun, 01 May 2016 17:28:52 -0400 Received: from mail.muc.de ([193.149.48.3]:60451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awyv3-0003rn-Uc for 23407@debbugs.gnu.org; Sun, 01 May 2016 17:28:50 -0400 Received: (qmail 60318 invoked by uid 3782); 1 May 2016 21:28:48 -0000 Received: from acm.muc.de (p579E946C.dip0.t-ipconnect.de [87.158.148.108]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 May 2016 23:28:46 +0200 Received: (qmail 2291 invoked by uid 1000); 1 May 2016 21:28:46 -0000 Date: Sun, 1 May 2016 21:28:46 +0000 Message-ID: <20160501212846.GA4228@acm.fritz.box> References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Glenn. On Sat, Apr 30, 2016 at 02:53:07PM -0400, Glenn Morris wrote: > PS dupe of http://debbugs.gnu.org/15577 More fully known as: Subject: bug#15577: 24.3; dir-local variables not applied when switching major-mode Date: Wed, 9 Oct 2013 16:14:00 -0400 From: yary Thanks for the reference. I'd actually searched debbugs for ".dir-locals" and found nothing. Anyhow, I've hacked a patch together. The idea is to call `hack-local-variables' from `run-mode-hooks' rather than from `normal-mode'. Of course, it's never quite that simple. The main thing is that the local variables are now set with the major mode rather than with the visiting of the file. So file/directory local variables are now not lost on setting the major mode. The following patch is based on the master branch from earlier on today. diff --git a/lisp/files.el b/lisp/files.el index 132ebce..940a9ac 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2322,8 +2322,13 @@ normal-mode ;; s-a-m and h-l-v may parse the same regions, looking for "mode:". (with-demoted-errors "File mode specification error: %s" (set-auto-mode)) - (with-demoted-errors "File local-variables error: %s" - (hack-local-variables))) + ;; delay-mode-hooks is set when `byte-compile-file' is the caller. + ;; It is essential that we call `hack-local-variables' in order to + ;; set up `lexical-binding', since `run-mode-hooks' is prevented + ;; from doing its job. + (when delay-mode-hooks + (with-demoted-errors "File local-variables error: %s" + (hack-local-variables 'no-mode)))) ;; Turn font lock off and on, to make sure it takes account of ;; whatever file local variables are relevant to it. (when (and font-lock-mode @@ -3297,11 +3302,15 @@ hack-local-variables-filter ;; TODO? Warn once per file rather than once per session? (defvar hack-local-variables--warned-lexical nil) -(defun hack-local-variables (&optional mode-only) +(defun hack-local-variables (&optional handle-mode) "Parse and put into effect this buffer's local variables spec. Uses `hack-local-variables-apply' to apply the variables. -If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" +If HANDLE-MODE is nil, we apply all the specified local +variables. If HANDLE-MODE is neither nil nor t, we do the same, +except that any settings of `mode' are ignored. + +If HANDLE-MODE is t, all we do is check whether a \"mode:\" is specified, and return the corresponding mode symbol, or nil. In this case, we try to ignore minor-modes, and only return a major-mode. @@ -3319,7 +3328,7 @@ hack-local-variables (let ((enable-local-variables (and local-enable-local-variables enable-local-variables)) result) - (unless mode-only + (unless (eq handle-mode t) (setq file-local-variables-alist nil) (with-demoted-errors "Directory-local variables error: %s" ;; Note this is a no-op if enable-local-variables is nil. @@ -3327,18 +3336,19 @@ hack-local-variables ;; This entire function is basically a no-op if enable-local-variables ;; is nil. All it does is set file-local-variables-alist to nil. (when enable-local-variables - ;; This part used to ignore enable-local-variables when mode-only - ;; was non-nil. That was inappropriate, eg consider the + ;; This part used to ignore enable-local-variables when handle-mode + ;; was t. That was inappropriate, eg consider the ;; (artificial) example of: ;; (setq local-enable-local-variables nil) ;; Open a file foo.txt that contains "mode: sh". ;; It correctly opens in text-mode. ;; M-x set-visited-file name foo.c, and it incorrectly stays in text-mode. (unless (or (inhibit-local-variables-p) - ;; If MODE-ONLY is non-nil, and the prop line specifies a + ;; If HANDLE-MODE is t, and the prop line specifies a ;; mode, then we're done, and have no need to scan further. - (and (setq result (hack-local-variables-prop-line mode-only)) - mode-only)) + (and (setq result (hack-local-variables-prop-line + (eq handle-mode t))) + (eq handle-mode t))) ;; Look for "Local variables:" line in last page. (save-excursion (goto-char (point-max)) @@ -3393,7 +3403,7 @@ hack-local-variables (goto-char (point-min)) (while (not (or (eobp) - (and mode-only result))) + (and (eq handle-mode t) result))) ;; Find the variable name; (unless (looking-at hack-local-variable-regexp) (error "Malformed local variable line: %S" @@ -3410,7 +3420,7 @@ hack-local-variables (forward-char 1) (let ((read-circle nil)) (setq val (read (current-buffer)))) - (if mode-only + (if (eq handle-mode t) (and (eq var 'mode) ;; Specifying minor-modes via mode: is ;; deprecated, but try to reject them anyway. @@ -3432,6 +3442,7 @@ hack-local-variables ;; to use 'thisbuf's name in the ;; warning message. (or (buffer-file-name thisbuf) "")))))) + ((and (eq var 'mode) handle-mode)) (t (ignore-errors (push (cons (if (eq var 'eval) @@ -3440,8 +3451,8 @@ hack-local-variables val) result)))))) (forward-line 1)))))))) ;; Now we've read all the local variables. - ;; If MODE-ONLY is non-nil, return whether the mode was specified. - (if mode-only result + ;; If HANDLE-MODE is t, return whether the mode was specified. + (if (eq handle-mode t) result ;; Otherwise, set the variables. (hack-local-variables-filter result nil) (hack-local-variables-apply))))) diff --git a/lisp/subr.el b/lisp/subr.el index 5f8d830..162ac21 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1732,10 +1732,14 @@ after-change-major-mode-hook (defun run-mode-hooks (&rest hooks) "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS. -If the variable `delay-mode-hooks' is non-nil, does not run any hooks, +Call `hack-local-variables' to set up file local and directory local +variables. + +If the variable `delay-mode-hooks' is non-nil, does not do anything, just adds the HOOKS to the list `delayed-mode-hooks'. Otherwise, runs hooks in the sequence: `change-major-mode-after-body-hook', -`delayed-mode-hooks' (in reverse order), HOOKS, and finally +`delayed-mode-hooks' (in reverse order), HOOKS, then runs +`hack-local-variables' and finally runs the hook `after-change-major-mode-hook'. Major mode functions should use this instead of `run-hooks' when running their FOO-mode-hook." (if delay-mode-hooks @@ -1746,6 +1750,9 @@ run-mode-hooks (setq hooks (nconc (nreverse delayed-mode-hooks) hooks)) (setq delayed-mode-hooks nil) (apply 'run-hooks (cons 'change-major-mode-after-body-hook hooks)) + (if (buffer-file-name) + (with-demoted-errors "File local-variables error: %s" + (hack-local-variables 'no-mode))) (run-hooks 'after-change-major-mode-hook))) (defmacro delay-mode-hooks (&rest body) -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 May 2016 04:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: yary , Glenn Morris , 23407@debbugs.gnu.org, Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146216174025519 (code B ref 23407); Mon, 02 May 2016 04:03:02 +0000 Received: (at 23407) by debbugs.gnu.org; 2 May 2016 04:02:20 +0000 Received: from localhost ([127.0.0.1]:32922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax53r-0006dX-TX for submit@debbugs.gnu.org; Mon, 02 May 2016 00:02:20 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax53p-0006dK-IN for 23407@debbugs.gnu.org; Mon, 02 May 2016 00:02:18 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYDQA731xV/0uLxEVcgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEkDSJOZlSgUUjgjuBWSKCeAEBAQ X-IPAS-Result: A0CYDQA731xV/0uLxEVcgxCEAshgBAICgTw8EQEBAQEBAQGBCkEFg10BAQMBViMFCwsOJhIUGA0kiDcIzyMBAQEBBgEBAQEeizqFBQeELQEEkDSJOZlSgUUjgjuBWSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="221264334" Received: from 69-196-139-75.dsl.teksavvy.com (HELO pastel.home) ([69.196.139.75]) by ironport2-out.teksavvy.com with ESMTP; 02 May 2016 00:02:11 -0400 Received: by pastel.home (Postfix, from userid 20848) id B8F206037C; Mon, 2 May 2016 00:02:11 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> <20160501212846.GA4228@acm.fritz.box> Date: Mon, 02 May 2016 00:02:11 -0400 In-Reply-To: <20160501212846.GA4228@acm.fritz.box> (Alan Mackenzie's message of "Sun, 1 May 2016 21:28:46 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Anyhow, I've hacked a patch together. The idea is to call > `hack-local-variables' from `run-mode-hooks' rather than from > `normal-mode'. Good idea. > + ;; delay-mode-hooks is set when `byte-compile-file' is the caller. > + ;; It is essential that we call `hack-local-variables' in order to > + ;; set up `lexical-binding', since `run-mode-hooks' is prevented > + ;; from doing its job. > + (when delay-mode-hooks > + (with-demoted-errors "File local-variables error: %s" > + (hack-local-variables 'no-mode)))) But this seems terribly brittle. Do we care about delay-mode-hooks (as the code says) or about byte-compile-file (as the comment says)? If it's the former, then the comment needs to be fixed, if it's the latter, than we need to find some other way to tell this code what's going on. Stefan From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 May 2016 07:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: yary , Glenn Morris , 23407@debbugs.gnu.org, Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146217476420055 (code B ref 23407); Mon, 02 May 2016 07:40:02 +0000 Received: (at 23407) by debbugs.gnu.org; 2 May 2016 07:39:24 +0000 Received: from localhost ([127.0.0.1]:32984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax8Rw-0005DN-Cc for submit@debbugs.gnu.org; Mon, 02 May 2016 03:39:24 -0400 Received: from mail.muc.de ([193.149.48.3]:42004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ax8Rt-0005DE-TZ for 23407@debbugs.gnu.org; Mon, 02 May 2016 03:39:23 -0400 Received: (qmail 27879 invoked by uid 3782); 2 May 2016 07:39:19 -0000 Received: from acm.muc.de (p548A435F.dip0.t-ipconnect.de [84.138.67.95]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 May 2016 09:39:18 +0200 Received: (qmail 3463 invoked by uid 1000); 2 May 2016 07:10:15 -0000 Date: Mon, 2 May 2016 07:10:15 +0000 Message-ID: <20160502071015.GA2048@acm.fritz.box> References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> <20160501212846.GA4228@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Stefan. Thanks for looking at my patch. On Mon, May 02, 2016 at 12:02:11AM -0400, Stefan Monnier wrote: > > Anyhow, I've hacked a patch together. The idea is to call > > `hack-local-variables' from `run-mode-hooks' rather than from > > `normal-mode'. > Good idea. > > + ;; delay-mode-hooks is set when `byte-compile-file' is the caller. > > + ;; It is essential that we call `hack-local-variables' in order to > > + ;; set up `lexical-binding', since `run-mode-hooks' is prevented > > + ;; from doing its job. > > + (when delay-mode-hooks > > + (with-demoted-errors "File local-variables error: %s" > > + (hack-local-variables 'no-mode)))) > But this seems terribly brittle. Do we care about delay-mode-hooks (as > the code says) or about byte-compile-file (as the comment says)? This bit of code was necessitated by: ######################################################################### commit 3ba6b3a9c1e0565ee5f45f11a9c09702a24f8453 Author: Artur Malabarba Date: Sun Apr 12 03:23:35 2015 +0100 Speed up byte-compilation and autoload generation by avoiding mode-hooks This prevents emacs-lisp-mode-hook from being run everytime an autoload file is generated, which can account for a fraction of package installation time depending on the hooks the user has configured. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use * delay-mode-hooks. * lisp/emacs-lisp/autoload.el (autoload-find-file) (autoload-find-generated-file): Use delay-mode-hooks. ######################################################################### if hack-local-variables isn't run, lexical-binding (for example) doesn't get set up, and make bootstrap fails. > If it's the former, then the comment needs to be fixed, if it's the > latter, than we need to find some other way to tell this code what's > going on. I don't really understand the question. Sure, that bit of code is ugly. But the comment both motivates ("it's `byte-compile-file''s fault") and explains the problem (which is that `delay-mode-hooks' being set would prevent `run-mode-hook', and thus `hack-local-variable' from running). It is possible that other stuff might call `normal-mode' like this. What sort of changes do you advocate for the comment (or for the code)? > Stefan -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2016 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: yary , Glenn Morris , 23407@debbugs.gnu.org, Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146229905110109 (code B ref 23407); Tue, 03 May 2016 18:11:02 +0000 Received: (at 23407) by debbugs.gnu.org; 3 May 2016 18:10:51 +0000 Received: from localhost ([127.0.0.1]:35649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axemZ-0002cz-3U for submit@debbugs.gnu.org; Tue, 03 May 2016 14:10:51 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axemX-0002cp-8i for 23407@debbugs.gnu.org; Tue, 03 May 2016 14:10:50 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u43IAjHH002084; Tue, 3 May 2016 14:10:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id E5CE760139; Tue, 3 May 2016 14:10:45 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> <20160501212846.GA4228@acm.fritz.box> <20160502071015.GA2048@acm.fritz.box> Date: Tue, 03 May 2016 14:10:45 -0400 In-Reply-To: <20160502071015.GA2048@acm.fritz.box> (Alan Mackenzie's message of "Mon, 2 May 2016 07:10:15 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: ** X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 2.2 X-NAI-Spam-Rules: 4 Rules triggered GMAIL_UNAME_2_DOT=1, GMAIL_UNAME_2_DOT_W_NOFROM_SGMAIL=1, NOFROM_SGMAIL=0.2, RV5661=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5661> : inlines <4753> : streams <1629440> : uri <2202488> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) >> > + ;; delay-mode-hooks is set when `byte-compile-file' is the caller. >> > + ;; It is essential that we call `hack-local-variables' in order to >> > + ;; set up `lexical-binding', since `run-mode-hooks' is prevented >> > + ;; from doing its job. >> > + (when delay-mode-hooks >> > + (with-demoted-errors "File local-variables error: %s" >> > + (hack-local-variables 'no-mode)))) >> But this seems terribly brittle. Do we care about delay-mode-hooks (as >> the code says) or about byte-compile-file (as the comment says)? > This bit of code was necessitated by: > ######################################################################### > commit 3ba6b3a9c1e0565ee5f45f11a9c09702a24f8453 > Author: Artur Malabarba > Date: Sun Apr 12 03:23:35 2015 +0100 > > Speed up byte-compilation and autoload generation by avoiding mode-hooks > > This prevents emacs-lisp-mode-hook from being run everytime an > autoload file is generated, which can account for a fraction of > package installation time depending on the hooks the user has > configured. > > * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use > * delay-mode-hooks. > > * lisp/emacs-lisp/autoload.el (autoload-find-file) > (autoload-find-generated-file): Use delay-mode-hooks. > ######################################################################### Hmm... so you're working around someone else's hack! > if hack-local-variables isn't run, lexical-binding (for example) doesn't > get set up, and make bootstrap fails. Of course: hack-local-variables should be run unconditionally. >> If it's the former, then the comment needs to be fixed, if it's the >> latter, than we need to find some other way to tell this code what's >> going on. > I don't really understand the question. Sure, that bit of code is ugly. > But the comment both motivates ("it's `byte-compile-file''s fault") and > explains the problem (which is that `delay-mode-hooks' being set would > prevent `run-mode-hook', and thus `hack-local-variable' from running). > It is possible that other stuff might call `normal-mode' like this. > What sort of changes do you advocate for the comment (or for the code)? How 'bout doing (setq-local hack-local-variables--done t) in hack-local-variables, and then testing that instead of testing delay-mode-hooks? Stefan From unknown Sat Jun 21 05:16:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Alan Mackenzie Subject: bug#23407: closed (Re: bug#23407: .dir-local settings get obliterated on running a major mode function.) Message-ID: References: <20160505112413.72418.qmail@mail.muc.de> <20160430102744.GA4644@acm.fritz.box> X-Gnu-PR-Message: they-closed 23407 X-Gnu-PR-Package: emacs Reply-To: 23407@debbugs.gnu.org Date: Thu, 05 May 2016 11:25:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1462447502-18340-1" This is a multi-part message in MIME format... ------------=_1462447502-18340-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #23407: .dir-local settings get obliterated on running a major mode functio= n. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 23407@debbugs.gnu.org. --=20 23407: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23407 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1462447502-18340-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23407-done) by debbugs.gnu.org; 5 May 2016 11:24:16 +0000 Received: from localhost ([127.0.0.1]:38756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHOB-0004ko-SS for submit@debbugs.gnu.org; Thu, 05 May 2016 07:24:15 -0400 Received: from mail.muc.de ([193.149.48.3]:35361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHOB-0004kh-3F for 23407-done@debbugs.gnu.org; Thu, 05 May 2016 07:24:15 -0400 Received: (qmail 72419 invoked by uid 3782); 5 May 2016 11:24:13 -0000 Date: 5 May 2016 11:24:13 -0000 Message-ID: <20160505112413.72418.qmail@mail.muc.de> From: Alan Mackenzie To: 23407-done@debbugs.gnu.org Subject: Re: bug#23407: .dir-local settings get obliterated on running a major mode function. Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE (amd64)) X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23407-done Cc: Alan Mackenzie X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Bug fixed in savannah master branch. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1462447502-18340-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Apr 2016 10:28:41 +0000 Received: from localhost ([127.0.0.1]:56394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awS8f-0007kd-KX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awS8e-0007kO-3F for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awS8O-000833-VX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS8O-00081z-TX for submit@debbugs.gnu.org; Sat, 30 Apr 2016 06:28:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS8D-0002zl-7N for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awS7x-0007uW-Fl for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:28:05 -0400 Received: from mail.muc.de ([193.149.48.3]:40318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awS7x-0007rT-6f for bug-gnu-emacs@gnu.org; Sat, 30 Apr 2016 06:27:57 -0400 Received: (qmail 41797 invoked by uid 3782); 30 Apr 2016 10:27:46 -0000 Received: from acm.muc.de (p5B146848.dip0.t-ipconnect.de [91.20.104.72]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Apr 2016 12:27:45 +0200 Received: (qmail 4700 invoked by uid 1000); 30 Apr 2016 10:27:44 -0000 Date: Sat, 30 Apr 2016 10:27:44 +0000 To: bug-gnu-emacs@gnu.org Subject: .dir-local settings get obliterated on running a major mode function. Message-ID: <20160430102744.GA4644@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Hello, Emacs. In the master branch (I'm sure it's the same in the emacs-25 branch, too): 1. start Emacs with emacs -Q 2. Visit any emacs lisp file which is part of Emacs with C-x C-f. 3. Do C-h C-v indent-tabs-mode . The *Help* buffer starts off with: indent-tabs-mode is a variable defined in `C source code'. Its value is nil Original value was t Local in buffer follow.el; global value is t . The local value comes from the .dir-locals in the top level Emacs directory. 4. Do M-x emacs-lisp-mode. 5. Again do C-h C-v indent-tabs-mode . This time, the *Help* buffer starts off with: indent-tabs-mode is a variable defined in `C source code'. Its value is t . This is different from the first *Help* buffer. 6. This is a bug. On running a major mode, directory local settings should be respected. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1462447502-18340-1-- From unknown Sat Jun 21 05:16:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: yary Subject: bug#15577: closed (Re: bug#23407: .dir-local settings get obliterated on running a major mode function.) Message-ID: References: <20160505112413.72418.qmail@mail.muc.de> X-Gnu-PR-Message: they-closed 15577 X-Gnu-PR-Package: emacs Reply-To: 15577@debbugs.gnu.org Date: Thu, 05 May 2016 11:25:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1462447502-18340-3" This is a multi-part message in MIME format... ------------=_1462447502-18340-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #23407: 24.3; dir-local variables not applied when switching major-mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 15577@debbugs.gnu.org. --=20 23407: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23407 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1462447502-18340-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23407-done) by debbugs.gnu.org; 5 May 2016 11:24:16 +0000 Received: from localhost ([127.0.0.1]:38756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHOB-0004ko-SS for submit@debbugs.gnu.org; Thu, 05 May 2016 07:24:15 -0400 Received: from mail.muc.de ([193.149.48.3]:35361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHOB-0004kh-3F for 23407-done@debbugs.gnu.org; Thu, 05 May 2016 07:24:15 -0400 Received: (qmail 72419 invoked by uid 3782); 5 May 2016 11:24:13 -0000 Date: 5 May 2016 11:24:13 -0000 Message-ID: <20160505112413.72418.qmail@mail.muc.de> From: Alan Mackenzie To: 23407-done@debbugs.gnu.org Subject: Re: bug#23407: .dir-local settings get obliterated on running a major mode function. Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.3-RELEASE (amd64)) X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 23407-done Cc: Alan Mackenzie X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Bug fixed in savannah master branch. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1462447502-18340-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Oct 2013 20:14:32 +0000 Received: from localhost ([127.0.0.1]:38542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VU09P-0008LX-B0 for submit@debbugs.gnu.org; Wed, 09 Oct 2013 16:14:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47264) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VU09L-0008LL-UZ for submit@debbugs.gnu.org; Wed, 09 Oct 2013 16:14:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU09K-0002j2-50 for submit@debbugs.gnu.org; Wed, 09 Oct 2013 16:14:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU09K-0002iy-2a for submit@debbugs.gnu.org; Wed, 09 Oct 2013 16:14:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU09I-00081a-Aw for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2013 16:14:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU09G-0002i8-MZ for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2013 16:14:24 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:35876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU09G-0002i4-CL for bug-gnu-emacs@gnu.org; Wed, 09 Oct 2013 16:14:22 -0400 Received: by mail-wi0-f182.google.com with SMTP id ez12so1476890wid.15 for ; Wed, 09 Oct 2013 13:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=j/45ITTET18EbG2oOxrUDu6WGptHg4dCWWkN2yZUSHI=; b=uKqKTTpDJM6/2SfoLMvJzzVWHejpFTB9Q5n7hlh2gp+GwkXXD975Fq3GwlOINtdqU1 4F8UIznsjpqfcN73EPUppc14yIA8sH1fhIOyRc6if0bAyZEAobL6gyVzmAXMwbcL2buz bo+8OLqSHx1+bO18SjtrHG0oSA9Xug5xPmbkbgqK0Tjkq1LTgM3txmXB0XdvWcAF0WS+ 0F7Qy9vawM0jtK7hoyFA5Tr7YEFjvmBJrVa5kdnFJ16fgdj2I9/QOQSYV+WnOXRuX+lD p9AkfYPiepmJ3fQbCImQtQkwTUz/4erg6ui4asagHzU/ps566S3LVi62iw6ihrUtpp2h 95JA== X-Received: by 10.194.78.78 with SMTP id z14mr8489640wjw.32.1381349660843; Wed, 09 Oct 2013 13:14:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.83.72 with HTTP; Wed, 9 Oct 2013 13:14:00 -0700 (PDT) From: yary Date: Wed, 9 Oct 2013 16:14:00 -0400 Message-ID: Subject: 24.3; dir-local variables not applied when switching major-mode To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgment at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': If I create a ".dir-locals.el" that applies to all major modes, such as: ((nil . ((tab-width . 3)))) It works when first opening any file under that directory- good. But, if I switch the buffer's major-mode, it loses the directory-local tab-width - and I've seen it lose other variables as well. An alternate case showing the same is to have a ".dir-locals.el" like: ((js-mode . ((tab-width . 3)))) and opening a non-JS file in the directory, such as an HTML file, and then switching to js-mode. Since I'm now editing the file in js-mode, I would want it to read the js-mode dir-local variables. Losing dir-locals seems like a bug to me, though perhaps there is a reason for it. I did notice from other dir-local-related bugs that they require some thought as to how to handle edge cases... In GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600) of 2013-03-17 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' Important settings: value of $LANG: ENU locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Info Minor modes in effect: yas-global-mode: t yas-minor-mode: t global-auto-complete-mode: t diff-auto-refine-mode: t recentf-mode: t desktop-save-mode: t 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-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums conf-mode sh-script smie executable info dos org-table org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks org-agenda org-info org-gnus org-docview org-bibtex bibtex org-bbdb face-remap gtags js json moz imenu thingatpt vc-git js2-mode-autoloads finder-inf undo-tree-autoloads package multi-web-mode mumamo-fun mumamo-chunks amrita desktop-autosave hide-lines yasnippet help-mode auto-complete-config auto-complete popup flymake-jslint flymake php-mode etags cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align speedbar sb-image ezimage dframe psvn derived log-edit pcvs-util add-log diff-mode elp ediff-merg ediff-diff ediff-wind ediff-mult ediff-help ediff-init ediff-util dired emacsw32 w32-integ w32shell w32-grep rebind ourcomments-widgets ourcomments-util rx cus-edit cus-start cus-load uniquify recentf tree-widget mm-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source eieio password-cache url-vars mailcap gnus gnus-ems nnheader gnus-util mail-utils mm-util mail-prsvr org ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs ido grep compile comint ansi-color ring bookmark pp apropos mumamo byte-opt warnings bytecomp byte-compile cconv advice help-fns advice-preload sgml-mode ruby-mode rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok mumamo-cmirr flyspell ispell desktop cc-engine cc-vars cc-defs new-key-seq-widget edmacro kmacro wid-edit hfyview easy-mmode easymenu htmlfontify cl-macs gv cl cl-lib noprint nxhtml-loader emacsw32-eol time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar 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 minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32 multi-tty emacs) ------------=_1462447502-18340-3-- From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 May 2016 11:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: yary , Glenn Morris , 23407@debbugs.gnu.org, Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.146244836925979 (code B ref 23407); Thu, 05 May 2016 11:40:01 +0000 Received: (at 23407) by debbugs.gnu.org; 5 May 2016 11:39:29 +0000 Received: from localhost ([127.0.0.1]:38776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHcv-0006kx-LZ for submit@debbugs.gnu.org; Thu, 05 May 2016 07:39:29 -0400 Received: from mail.muc.de ([193.149.48.3]:50990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayHcu-0006kp-8X for 23407@debbugs.gnu.org; Thu, 05 May 2016 07:39:28 -0400 Received: (qmail 74824 invoked by uid 3782); 5 May 2016 11:39:27 -0000 Received: from acm.muc.de (p548C62E6.dip0.t-ipconnect.de [84.140.98.230]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 05 May 2016 13:39:25 +0200 Received: (qmail 13206 invoked by uid 1000); 5 May 2016 11:39:25 -0000 Date: Thu, 5 May 2016 11:39:25 +0000 Message-ID: <20160505113925.GB1950@acm.fritz.box> References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> <20160501212846.GA4228@acm.fritz.box> <20160502071015.GA2048@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) Hello, Stefan. On Tue, May 03, 2016 at 02:10:45PM -0400, Stefan Monnier wrote: > >> > + ;; delay-mode-hooks is set when `byte-compile-file' is the caller. > >> > + ;; It is essential that we call `hack-local-variables' in order to > >> > + ;; set up `lexical-binding', since `run-mode-hooks' is prevented > >> > + ;; from doing its job. > >> > + (when delay-mode-hooks > >> > + (with-demoted-errors "File local-variables error: %s" > >> > + (hack-local-variables 'no-mode)))) > >> But this seems terribly brittle. Do we care about delay-mode-hooks (as > >> the code says) or about byte-compile-file (as the comment says)? [ .... ] > Hmm... so you're working around someone else's hack! Yes, so is life. > > if hack-local-variables isn't run, lexical-binding (for example) doesn't > > get set up, and make bootstrap fails. > Of course: hack-local-variables should be run unconditionally. > >> If it's the former, then the comment needs to be fixed, if it's the > >> latter, than we need to find some other way to tell this code what's > >> going on. > > I don't really understand the question. Sure, that bit of code is ugly. > > But the comment both motivates ("it's `byte-compile-file''s fault") and > > explains the problem (which is that `delay-mode-hooks' being set would > > prevent `run-mode-hook', and thus `hack-local-variable' from running). > > It is possible that other stuff might call `normal-mode' like this. > > What sort of changes do you advocate for the comment (or for the code)? > How 'bout doing > (setq-local hack-local-variables--done t) > in hack-local-variables, and then testing that instead of testing > delay-mode-hooks? That's even more horrible. What I've done is tidy up the comment (which now makes no reference to byte-compile-file) and committed the change. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From unknown Sat Jun 21 05:16:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23407: .dir-local settings get obliterated on running a major mode function. Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 May 2016 12:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: yary , Glenn Morris , 23407@debbugs.gnu.org, Dmitry Gutov Received: via spool by 23407-submit@debbugs.gnu.org id=B23407.1462452844423 (code B ref 23407); Thu, 05 May 2016 12:55:01 +0000 Received: (at 23407) by debbugs.gnu.org; 5 May 2016 12:54:04 +0000 Received: from localhost ([127.0.0.1]:38846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayIn5-00006l-UU for submit@debbugs.gnu.org; Thu, 05 May 2016 08:54:04 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:44875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayIn4-00006Y-6u for 23407@debbugs.gnu.org; Thu, 05 May 2016 08:54:02 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u45Cs0Rt025075; Thu, 5 May 2016 08:54:01 -0400 Received: by pastel.home (Postfix, from userid 20848) id B767960090; Thu, 5 May 2016 08:54:00 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20160430102744.GA4644@acm.fritz.box> <0joa8rszhb.fsf@fencepost.gnu.org> <20160501212846.GA4228@acm.fritz.box> <20160502071015.GA2048@acm.fritz.box> <20160505113925.GB1950@acm.fritz.box> Date: Thu, 05 May 2016 08:54:00 -0400 In-Reply-To: <20160505113925.GB1950@acm.fritz.box> (Alan Mackenzie's message of "Thu, 5 May 2016 11:39:25 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5663=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5663> : inlines <4762> : streams <1630403> : uri <2203675> X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) >> (setq-local hack-local-variables--done t) >> in hack-local-variables, and then testing that instead of testing >> delay-mode-hooks? > That's even more horrible. Huh? It makes it clear what's going on: the find-file part of the code wants to make sure that hack-local-variables is called, so hack-local-variables sets a var when it's called, and find-file checks it to know whether that's been done or not. It's reliable and contrary to the code you had, it doesn't need to care about packages unrelated to find-file nor to hack-local-variables, nor about variables which are similarly unrelated to find-file nor to hack-local-variables. Stefan