From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jay Kamat Newsgroups: gmane.emacs.help Subject: Re: Dir-Locals + Editorconfig Changes in Emacs 26 Date: Wed, 04 Oct 2017 11:45:45 -0400 Message-ID: <87poa2532u.fsf@gmail.com> References: <873771wi22.fsf@gmail.com> <83d1641brw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507132169 27098 195.159.176.226 (4 Oct 2017 15:49:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 15:49:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 17:49:21 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzlvC-0005oR-B9 for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 17:49:18 +0200 Original-Received: from localhost ([::1]:35735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzlvH-0008Bg-Tz for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Oct 2017 11:49:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzlrt-0005jN-0N for help-gnu-emacs@gnu.org; Wed, 04 Oct 2017 11:45:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzlro-0007eK-Ql for help-gnu-emacs@gnu.org; Wed, 04 Oct 2017 11:45:53 -0400 Original-Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:47244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzlro-0007dS-NY; Wed, 04 Oct 2017 11:45:48 -0400 Original-Received: by mail-qt0-x236.google.com with SMTP id z50so14987272qtj.4; Wed, 04 Oct 2017 08:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zfebN4Vd7kGLGvFOotipRKhUSlo9+nKuLtxCIwxJpeo=; b=fOqkxdPEMhmpacdvxCnsoJ7xL6K8vWa+pdlksNzYdby3o1V+y2JquSH6X0ml1wbx2z XWxYXYP2Uo7WoI1A2p6g4cSm2ag3Y9/MJw71LkzFt66hCtywHYscc9jR4KYSAlZS7bWW HNPUTVKmRC2GcdvdzPQs2RPzynG7M1jIxjvxZEHM0St+vYtIMpSQCA93uYBVZkPAUoRc 6xWhnVIZoY6+JD8EpRwUUvtoUwzNEggVuyH6fA7W88rSuL9AHyanYSyLoJSKJUPBJ4j2 2r4KayPtIOgoVzWZq7mhYk5TP3+ZLUOv/SdeQkzqmrX2xGu3MpLi7d9yO1BsuCjwporT ZGhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zfebN4Vd7kGLGvFOotipRKhUSlo9+nKuLtxCIwxJpeo=; b=S8nQPoCOoktyuYB35wruJQYEqXbDGoy/nvJxQlIh81uI6tzS/XjDqpZTWPOAAlY/b6 /ML8ZUH1sppcAOeuTFC5wsK3su2Y2qmXzhCHAfmUY+D49xcfqVj/gA02JF+U274h4T6R xRLFKgUkSO6aMMYLvZtRjYSTdq3UuH82FiYD6g/DAZIWIy91xML/y/uiVwj4dXqKMbvR oZZLaBjZiiZcYoJwp1qoxN9QbJgnL1EIADaYLakSS6NONAE44hkYFRZ8irz5qGX5yzBc cHR0qzBnu+jHXgxEJ3nV39eHTPg8GlMtPZ5X2YuEeLQpfwbHwx/ZRs9GD8BXgvSxQJsi pKNA== X-Gm-Message-State: AHPjjUhAhoM4n6OGLbDBw81GXTxL5tAEEwLgJ9J9qOnGknDWSHd2S4qO FuIQg+5TNxm8lWBoAgUYdDNJ5aWQ X-Google-Smtp-Source: AOwi7QAJslj886iSPhzfKnqN88cF3lR0JnDMI2tLRooHDMIj4cgMFRqX22gdXO2TIeTOMayz1gBkWQ== X-Received: by 10.129.138.67 with SMTP id a64mr17608159ywg.360.1507131947377; Wed, 04 Oct 2017 08:45:47 -0700 (PDT) Original-Received: from laythe (res380d-128-61-81-32.res.gatech.edu. [128.61.81.32]) by smtp.gmail.com with ESMTPSA id w4sm2726458ywe.88.2017.10.04.08.45.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2017 08:45:46 -0700 (PDT) In-Reply-To: <83d1641brw.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Oct 2017 18:39:15 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::236 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114515 Archived-At: Eli Zaretskii writes: >> From: Jay Kamat >> Date: Mon, 02 Oct 2017 13:55:33 -0400 >> >> However, since emacs 26, this is reversed, where dir-locals is applied >> first, rather than last, and so editorconfig overrides dir-locals. I >> have filed a bug report to the project here to document it: >> https://github.com/editorconfig/editorconfig-emacs/issues/141 >> >> The reason that this is significant is that editorconfig not only lets >> you configure on a per-project basis, but recursively on a per machine >> basis as well, so if you have a editorconfig file in your home directory >> (as many people do) those settings will apply for every file on your >> system, overwriting dir-locals settings. Since dir-locals is more >> powerful and project-specific, I would much prefer dir-locals to >> override editorconfig. >> >> Editorconfig seems to apply on the 'after-change-major-mode' hook, as >> shown below: > > Could it be that the major mode hook is now called twice, and > Editorconfig fails to notice that one of these calls is to turn the > mode off? Is `after-change-major-mode' getting called twice in emacs 26, but not 25? I can't seem to find a related news entry about the change, could you point me to more information about that? I took a look at the implementation of `after-change-major-mode', and I found `change-major-mode-after-body-hook' nearby, which seems to do what I want at a first glance (running hooks before dir-locals is set). Does changing the hook seem like the proper way to solve this? Thanks, -Jay