Subject: Re: bug#44698: 27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode

From: Sean Whitton <[email-masked]>
Date: Mon, 10 Mar 2025 17:18:11 +0800

Hello,

On Sat 08 Mar 2025 at 05:11pm +08, Sean Whitton wrote:

> Hello,
>
> On Sat 08 Mar 2025 at 08:07am GMT, Stefan Kangas wrote:
>
>> I think you can use `kill-all-local-variables` for this:
>>
>>     (kill-all-local-variables 'kill-permanent)
>
> Oh, thanks, I never knew it could take an argument.
> I think the thing to do here then is add that to vc-log-internal-common.
> We're a long way from releasing Emacs 31 so if this does break something
> else, we'll find out.
>
> Installed the change and closing the bug.

While preparing a fix for #59457 I discovered that invoking vc-print-log
already makes a call to kill-all-local-variables, in vc-setup-buffer.
So calling it in vc-log-internal-common too isn't right.

In other words, the place to fix this is in vc-setup-buffer, which
already has special handling for default-directory.

I've replaced the fix with one in vc-setup-buffer, and also fixed #59457.

-- 
Sean Whitton