Subject: bug#46813: 27.0.91; Form `(subdirs . nil)' in .dir-locals.el does not protect subdirectories

From: Sebastian Tennant <[email-masked]>
Date: Sat, 27 Feb 2021 17:05:23 +0000

Quoth Lars Ingebrigtsen <[email-masked]>
on Sat, 27 Feb 2021 15:09:30 +0100:
> Sebastian Tennant <[email-masked]> writes:
>
>> According to the sexp written to file tmp/.dir-locals.el in 4, variable
>> `foo' should only be bound to `bar' in files under tmp/.  However, when
>> file tmp/sub/baz is visited in 6, the local variables list includes the
>> binding 'foo : bar', deemed to be risky.
>>
>> The relevant section of (info "(emacs) Directory Variables") reads:
>>
>>  "The special ‘subdirs’ element is not a variable, but a special keyword
>>  which indicates that the [...] settings are only to be applied in the
>>  current directory, not in any subdirectories."
>>
>> Bug, documentation bug or thinko?
>
> There's been quite a few fixed in the .dir-locals.el code in the
> development branch over the past few months.  Would it be possible for
> you to check "master" and see whether the problem still exists there?

It's fixed on master.

Any tips on how to backport the fix to emacs-27?