GNU bug report logs - #44698
27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode

Previous Next

Package: emacs;

Reported by: Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com>

Date: Mon, 16 Nov 2020 20:31:02 UTC

Severity: normal

Found in version 27.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#44698: closed (27.1; dir-locals.el stay on file-local-variables-alist
 when using vc-mode)
Date: Sat, 08 Mar 2025 09:12:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 08 Mar 2025 17:11:26 +0800
with message-id <875xkjnayp.fsf <at> melete.silentflame.com>
and subject line Re: bug#44698: 27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode
has caused the debbugs.gnu.org bug report #44698,
regarding 27.1; dir-locals.el stay on file-local-variables-alist when using vc-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
44698: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44698
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Christopher Lemmer Webber <cwebber <at> dustycloud.org>
Subject: 27.1; dir-locals.el stay on file-local-variables-alist when using
 vc-mode
Date: Mon, 16 Nov 2020 21:30:43 +0100
[Message part 3 (text/plain, inline)]
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")))))

[reproducer.sh (application/x-sh, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Sean Whitton <spwhitton <at> spwhitton.name>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Christopher Lemmer Webber <cwebber <at> dustycloud.org>,
 Miguel Ángel Arruga Vivas <rosen644835 <at> gmail.com>,
 44698-done <at> debbugs.gnu.org, emacs-devel <at> gnu.org
Subject: Re: bug#44698: 27.1; dir-locals.el stay on
 file-local-variables-alist when using vc-mode
Date: Sat, 08 Mar 2025 17:11:26 +0800
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


This bug report was last modified 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.