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

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 06 May 2021 11:04:56 +0200

Stefan Monnier <[email-masked]> writes:

> 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)?

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

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no