From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18721: patch Date: Sun, 15 Jan 2017 17:33:30 +0200 Message-ID: <83o9z89w39.fsf@gnu.org> References: <87ppduza9c.fsf@tromey.com> <87vath2gl1.fsf@tromey.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1484494458 24887 195.159.176.226 (15 Jan 2017 15:34:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Jan 2017 15:34:18 +0000 (UTC) Cc: 18721@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 15 16:34:14 2017 Return-path: Envelope-to: geb-bug-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 1cSmor-0005Yy-ME for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jan 2017 16:34:09 +0100 Original-Received: from localhost ([::1]:51941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSmow-0000gs-7V for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Jan 2017 10:34:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSmon-0000ft-NH for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2017 10:34:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSmok-00036i-JY for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2017 10:34:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSmok-00036e-Fp for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2017 10:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cSmok-0002I4-A7 for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2017 10:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jan 2017 15:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18721 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18721-submit@debbugs.gnu.org id=B18721.14844944078757 (code B ref 18721); Sun, 15 Jan 2017 15:34:02 +0000 Original-Received: (at 18721) by debbugs.gnu.org; 15 Jan 2017 15:33:27 +0000 Original-Received: from localhost ([127.0.0.1]:54969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSmoB-0002HB-CG for submit@debbugs.gnu.org; Sun, 15 Jan 2017 10:33:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSmo9-0002Gy-Ld for 18721@debbugs.gnu.org; Sun, 15 Jan 2017 10:33:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSmo1-0002vR-7z for 18721@debbugs.gnu.org; Sun, 15 Jan 2017 10:33:20 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSmo1-0002vN-4Z; Sun, 15 Jan 2017 10:33:17 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2259 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cSmo0-0002oD-Ac; Sun, 15 Jan 2017 10:33:16 -0500 In-reply-to: <87vath2gl1.fsf@tromey.com> (message from Tom Tromey on Sat, 14 Jan 2017 19:38:02 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:128132 Archived-At: > From: Tom Tromey > Date: Sat, 14 Jan 2017 19:38:02 -0700 > > This patch adds the feature described in this bug. There are a few > possible ways to do it, this picks a simple one: mimic auto-mode-alist > directly. > > Let me know what you think. Thanks. This will need a NEWS entry. Also, I have a comment/concern: > +The special key @code{auto-mode-alist} in a @file{.dir-locals.el} lets > +you set a file's major mode. It works much like the variable > address@hidden (@pxref{Choosing Modes}). For example, here is > +how you can tell Emacs that @file{.def} source files in this directory > +should be in C mode: > + > +@example > +((auto-mode-alist . (("\\.def\\'" . c-mode)))) > +@end example I'm concerned that this syntax deviates from the current syntax of .dir-locals.el, which is this: (KEY . ((VARIABLE1 . VALUE1) (VARIABLE2 . VALUE2) ...)) where KEY can be: . nil, meaning it's applicable to any file in the directory tree; . a major mode (not relevant to this discussion) . a subdirectory name, meaning the setting is applicable to files in that subdirectory Your suggestion uses a form of just (VARIABLE . VALUE), effectively using the variable name as KEY, which differs from the above, and also loses the capability of specifying a value only for some subdirectory. So I'm asking why not keep the current syntax for this feature, and avoid introducing a new kind of special key? This would mean your example above will look like this: (nil . ((auto-mode-alist . (("\\.def\\'" . c-mode)))))