unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yikai Zhao <yikai@z1k.dev>
To: 74964@debbugs.gnu.org
Subject: bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode
Date: Thu, 19 Dec 2024 15:53:58 +0800	[thread overview]
Message-ID: <CANMyjphK1y5bnyZD_b6bLxEtOA_V0MsXqSphOsrvjEojcGxotA@mail.gmail.com> (raw)

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.





             reply	other threads:[~2024-12-19  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19  7:53 Yikai Zhao [this message]
2024-12-20 16:20 ` bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANMyjphK1y5bnyZD_b6bLxEtOA_V0MsXqSphOsrvjEojcGxotA@mail.gmail.com \
    --to=yikai@z1k.dev \
    --cc=74964@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).