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

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 08 Mar 2025 09:12:01 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
44698: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44698
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#44698: 27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode
From: Sean Whitton <[email-masked]>
To: Stefan Kangas <[email-masked]>
Cc: Christopher Lemmer Webber <[email-masked]>, Miguel Ángel Arruga Vivas <[email-masked]>, [email-masked], [email-masked]
Date: Sat, 08 Mar 2025 17:11:26 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

-- 
Sean Whitton

Subject: 27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode
From: Miguel Ángel Arruga Vivas <[email-masked]>
To: [email-masked]
Cc: Christopher Lemmer Webber <[email-masked]>
Date: Mon, 16 Nov 2020 21:30:43 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

While using vc-mode, the dir-locals.el variables under 'nil' mode are
accumulated on file-local-variables-alist and they still apply after
exiting the scope of the file.  The attached script can be used to
reproduce it (Emacs 27.1, on GNU Guix
f6e031ab36fd99ad3536caabfdaefcc2b5f606a1).

It generates a temporary folder with two example git repositories, an
offending dir-locals.el[1], launches an emacs with -Q and the shows
the steps to follow:

1. Open p1/file and accept the .dir-locals.el variables.
2. Call vc-print-log
3. Check the file-local-variables-alist
4. Open p2/file (this one doesn't have .dir-locals.el).
5. Call vc-print-log again, the message is shown again.

Best regards,
Miguel

[1] It contains: ((nil . ((eval (message "Eval called")))))