Subject: bug#54405: 27.1; How to reset connection-local variable

From: David Landell <[email-masked]>
Date: Fri, 18 Mar 2022 17:57:06 +0100

Excellent,

> Michael Albinus <[email-masked]> writes:
>
>
> I've pushed a change to the Emacs master git branch, which allows to
> change the application in `with-connection-local-variables'. The Elisp
> manual has been extended with
>
> Does this suffice?
>

This seems to work fine as far as I can tell and as far as my testing
goes with this feature isolated. There is however a small complication
which I don't know if it is to be considered a bug or not.

Still this fails with my package. I discovered that this is because
`hack-dir-local-variables-non-file-buffer' is called at some point for a
totally unrelated variable to be applied. The actual trigger point is
`hack-local-variables-apply'.

So further debugging indicates that the connection-local variable that
is applied (and reset) in `with-connection-local-variables' is also
added to `file-local-variables-alist' which makes it a buffer local
during the call to `hack-local-variables-apply'.

Question is if the file-local should be reset at the same time as
`kill-local-variable' is called in `with-connection-local-variables'?

Anyway, on my end this can be resolved, I have a workaround in place. So
this is mostly FYI.

Cheers,
David

> Best regards, Michael.