From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: yary Newsgroups: gmane.emacs.bugs Subject: bug#15577: 24.3; dir-local variables not applied when switching major-mode Date: Sat, 19 Oct 2013 15:08:17 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1382209753 6438 80.91.229.3 (19 Oct 2013 19:09:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2013 19:09:13 +0000 (UTC) Cc: 15577 <15577@debbugs.gnu.org> To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 19 21:09:16 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VXbti-00081m-RH for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 21:09:15 +0200 Original-Received: from localhost ([::1]:34127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXbti-0003gT-Cd for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Oct 2013 15:09:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXbtb-0003g9-AS for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 15:09:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VXbtW-00085Z-Hy for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 15:09:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VXbtW-00085R-ES for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 15:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VXbtV-0003qk-Qc for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2013 15:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: yary Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2013 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15577 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15577-submit@debbugs.gnu.org id=B15577.138220972614771 (code B ref 15577); Sat, 19 Oct 2013 19:09:01 +0000 Original-Received: (at 15577) by debbugs.gnu.org; 19 Oct 2013 19:08:46 +0000 Original-Received: from localhost ([127.0.0.1]:58194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXbtG-0003qA-08 for submit@debbugs.gnu.org; Sat, 19 Oct 2013 15:08:46 -0400 Original-Received: from mail-we0-f171.google.com ([74.125.82.171]:49253) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VXbtD-0003pv-So for 15577@debbugs.gnu.org; Sat, 19 Oct 2013 15:08:44 -0400 Original-Received: by mail-we0-f171.google.com with SMTP id t60so4928287wes.16 for <15577@debbugs.gnu.org>; Sat, 19 Oct 2013 12:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=uik3nXMtFqLzKW6MrkasuXbQqxUixuzDWTd0r0Mp2I0=; b=MrrvwCRkH7hfUbdxMRMdtc0iZ2RHIfOD3u1elG6s8ffgLtVwYr0ZGfS1GwSr6eIFd+ JjVKxkkyF2fmuwA4uviCQHFkYwS5kTxZpWjK6wlXePuaTsiWaCMVKlvDieOrUDUF2ZQo jRSpdjE0VrpydWsp64a1kXWzMxkdZ7mBqfBa2QRYIMBjmBbW/COPas9XwndUf/bwHvZe hwy5rtfJAkso2UlSqYY9RcQCLxY8k4dFyooCVasJ4TkVPOdslSCTpgoDILBDnGrhugIX exewDzLR+Uj689ZnNg0QFKeY4U+xvioS0AYfwtSNp7VBkCrJebuaefnNF96glnq4mQBe yUtQ== X-Received: by 10.180.185.101 with SMTP id fb5mr3864046wic.11.1382209717929; Sat, 19 Oct 2013 12:08:37 -0700 (PDT) Original-Received: by 10.194.83.72 with HTTP; Sat, 19 Oct 2013 12:08:17 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79397 Archived-At: On Fri, Oct 18, 2013 at 9:18 PM, Stefan Monnier wrote: >> For sub-issue #1 "dir-locals not being applied in the new mode," >> divide the responsibility for setting file-locals and dir-locals >> between `normal-mode find-file=t' and `define-derived-mode'. Just have >> `define-derived-mode' call >> `(hack-dir-local-variables)(hack-local-variables-apply)' unless it is >> being called as a result of `normal-mode t'. There's no change needed >> for the normal-mode function or anything it calls, except perhaps >> setting something that the define-derived-mode macro can check. > > Yes, as mentioned earlier, a possible fix is to move the file-local and > dir-local setup code from normal-mode to after-change-major-mode-hook. Moving dir-local setup code to after-change-major-mode-hook would be a simple fix for issue #1. File-local (as it is now) in after-change-major-mode-hook would cause some problems eg. if a file-local sets the mode! I'm opening a new bug for handling file-locals after major-mode-change, it's different enough to warrant its own discussion (and will also answer your questions about what I meant there), The initial report here was about dir-locals, which has a solution independent from the other buffer-local issues; let's just keep this bug#15577 about re-applying dir locals after a mode change.