unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode
@ 2024-12-19  7:53 Yikai Zhao
  2024-12-20 16:20 ` Robert Pluim
  0 siblings, 1 reply; 2+ messages in thread
From: Yikai Zhao @ 2024-12-19  7:53 UTC (permalink / raw)
  To: 74964

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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode
  2024-12-19  7:53 bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode Yikai Zhao
@ 2024-12-20 16:20 ` Robert Pluim
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Pluim @ 2024-12-20 16:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Yikai Zhao, 74964

>>>>> On Thu, 19 Dec 2024 15:53:58 +0800, Yikai Zhao <yikai@z1k.dev> said:

    Yikai> How to reproduce:
    Yikai> With following content in /tmp/test/.dir-locals.el:

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

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

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

    Yikai> Emacs 29 and 30 does give me the expected result.

Stefan, reverting f713258416f (Bug#74349) fixes this

Robert
-- 





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-20 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19  7:53 bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode Yikai Zhao
2024-12-20 16:20 ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).