From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: dir-local vs major-mode setting Date: Wed, 14 Nov 2018 17:19:16 -0500 Message-ID: References: <768a1a8509311e0e5308ef87c53875a0@webmail.orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542233842 31211 195.159.176.226 (14 Nov 2018 22:17:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2018 22:17:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 14 23:17:18 2018 Return-path: Envelope-to: ged-emacs-devel@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 1gN3TJ-0007zY-A3 for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2018 23:17:17 +0100 Original-Received: from localhost ([::1]:34414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN3VP-00023F-P1 for ged-emacs-devel@m.gmane.org; Wed, 14 Nov 2018 17:19:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN3VJ-000234-Uk for emacs-devel@gnu.org; Wed, 14 Nov 2018 17:19:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gN3VG-0002cG-0R for emacs-devel@gnu.org; Wed, 14 Nov 2018 17:19:21 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:36792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gN3VF-0002c4-Sc for emacs-devel@gnu.org; Wed, 14 Nov 2018 17:19:17 -0500 Original-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 wAEMJG1Q019715; Wed, 14 Nov 2018 17:19:16 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 77C1F69594; Wed, 14 Nov 2018 17:19:16 -0500 (EST) In-Reply-To: <768a1a8509311e0e5308ef87c53875a0@webmail.orcon.net.nz> (Phil Sainty's message of "Thu, 15 Nov 2018 10:58:29 +1300") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6418=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6418> : inlines <6959> : streams <1804280> : uri <2749721> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231156 Archived-At: > I use the major mode hooks to set my preferred behaviour for each > mode, and dir-local settings to override them in cases where I should > *not* be using the defaults (e.g. to enforce a particular project's > coding standards). I'm thinking of a case where the project says "you should use TABs" so it sets ((nil . ((indent-tabs-mode . t)))) in the .dir-locals.el file. But TABs in TeX files tend to behave funny, so tex-mode.el sets indent-tabs-mode to nil. Assuming the .dir-locals.el setting was meant for "the majority of the files" and those aren't .tex files, it would make sense to favor the major mode's setting for the few .tex files. I guess sometimes you want one and sometimes you want the other. So maybe to handle that case we'd want to introduce another wildcard that works like the `nil` above but implies it's applied before running the major mode's setup function. Stefan