Subject: Re: bug#47843: 28.0.50; Setting enable-local-variables to nil *appears* to inhibit lexical-binding (but doesn't)

From: Stefan Monnier <[email-masked]>
Date: Thu, 06 May 2021 09:32:04 -0400

>> Indeed, an exception would be welcome for that var, otherwise there will
>> be bad surprises.  We could probably have a variable holding a list of
>> vars that always obey file-local settings.
>
> Poking around for a couple of minutes, would the right way to implement
> this be to always call `hack-local-variables' in `set-auto-mode' here?
>
>     ;; hack-local-variables checks local-enable-local-variables etc, but
>     ;; we might as well be explicit here for the sake of clarity.
>     (and (not done)
> 	 enable-local-variables
> 	 local-enable-local-variables
> 	 try-locals
> 	 (setq mode (hack-local-variables t))
>
> But then filter out all variables except the ones in this new list in
> `hack-local-variables-filter' (if `enable-local-variables' is nil)?

Sounds about right.

> The new list could be called...  uhm...
> `permanently-enabled-local-variables'?

I like mine pink with grey octagons.

        Stefan