Subject: bug#74964: closed (Re: bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 05 Jan 2025 15:06:02 +0000

Your bug report

#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major 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].

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

Subject: Re: bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode
From: Stefan Monnier <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], Yikai Zhao <[email-masked]>, [email-masked]
Date: Sun, 05 Jan 2025 10:05:06 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

>> This patch does fix the issue for me. Thanks.

Thank you for confirming!

> Thanks for testing.  Stefan, please install, and thanks.

Closing,

        Stefan

Subject: 31.0.50 master; .dir-locals.el vars does not work with changing major mode
From: Yikai Zhao <[email-masked]>
To: [email-masked]
Date: Thu, 19 Dec 2024 15:53:58 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

How to reproduce:

With following content in /tmp/test/.dir-locals.el:

((nil . ((my/test . "test")))
 (c-mode . ((eval . (when (eq major-mode 'c-mode)
                      (c++-mode))))))
;; I use this code because I want my projects' .h files always opened
in c++ mode

Then open a new file test.c in the folder.

Expected behavior: my/test variable is set.
Actual behavior: my/test variable is not set.

Emacs 29 and 30 does give me the expected result.