GNU bug report logs - #33400
26.1; Order changed for overriding “nil” mode in dir-locals

Previous Next

Package: emacs;

Reported by: Neil Roberts <bpeeluk <at> yahoo.co.uk>

Date: Thu, 15 Nov 2018 14:20:05 UTC

Severity: normal

Tags: fixed, patch

Merged with 30008, 35522

Found in versions 26.0.90, 26.1, 27.0.50

Fixed in version 26.3

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 33400 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Neil Roberts <bpeeluk <at> yahoo.co.uk>, 33400 <at> debbugs.gnu.org
Subject: Re: bug#33400: [PATCH] Let dir locals for more specific modes
 override those from less
Date: Mon, 29 Apr 2019 14:58:34 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

>> The list of dir local variables to apply is now sorted by the number
>> of parent modes of the mode used as the key in the association
>> list. That way when the variables are applied in order the variables
>> from more specific modes will override those from less specific modes.
>>
>> If there are directory entries in the list then they are sorted in
>> order of name length. The list of modes for that dir is then
>> recursively sorted with the same mechanism. That way variables tied to
>> a particular subdirectory override those in in a parent directory.
>>
>> Previously the behaviour didn’t seem to be well defined anyway and was
>> dependent on the order they appeared in the file. However this order
>> was changed in version 26.1 and it probably also depended on the
>> number of dir-local files that are merged.
>
> This patch looks basically good to me (some minor formatting: sentences
> should end in double space, and the commit message misses a ChangeLog
> formatted entry), but it exceeds to copyright exemption limit.  Would
> you be willing to sign papers?

I also believe the patch is worth to be applied, to the emacs-26
branch. It fixes a regression introduced with Emacs 26.1.

I'd appreciate if this behavior, priority of .dir-locals entries, is
documented in the Emacs manual. Could this be added to the patch?

Thanks, and best regards, Michael.




This bug report was last modified 6 years and 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.