From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#74964: 31.0.50 master; .dir-locals.el vars does not work with changing major mode Date: Fri, 20 Dec 2024 17:20:10 +0100 Message-ID: <87zfkqtjgl.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yikai Zhao , 74964@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 17:27:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOfqR-0006PT-6A for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 17:27:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOflc-0005u4-4x; Fri, 20 Dec 2024 11:22:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOflL-0005gn-5G for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:22:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOflK-0000MF-MR for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:22:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ytGZ0nI53VBxEzcjd3viq0QEuZU3im5u1tYkU2H4xBc=; b=F36JIIiOIV+IrCOadaOx3pZFJq8rO2WV8oV1w711U4wM8hNq5bMznadipB8+NOBciF5kyRTW52mELF8xc1j5U8gCny82rBCYvtFWzyGpVwJ2N8ck0lJm86EF13JNjkB8cEmDaPW60T/xJZ5s6+Q542Ak+ZV5skxITxdHD/cDi9szB1v9k4RfbrJQwO2WSCF1Cvv7IdU/ors4ZydVV+iGfWiKN5fqdPmIUH6MczzO9BMwoSEFRLmaqsNsmXrobJye4eqBnUM2FTCOsk3zQ6Nun3ZKFy5369cddyzSG1+4BRYAVzcYSA3OV7rY6WaIYaLPdv0HSG5RThkiLzKM9a8x3A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOflK-00017A-FZ for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 11:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 16:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74964 X-GNU-PR-Package: emacs Original-Received: via spool by 74964-submit@debbugs.gnu.org id=B74964.17347116804223 (code B ref 74964); Fri, 20 Dec 2024 16:22:02 +0000 Original-Received: (at 74964) by debbugs.gnu.org; 20 Dec 2024 16:21:20 +0000 Original-Received: from localhost ([127.0.0.1]:43768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfke-000162-0v for submit@debbugs.gnu.org; Fri, 20 Dec 2024 11:21:20 -0500 Original-Received: from mail-wm1-f53.google.com ([209.85.128.53]:53249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOfkb-00015m-K9 for 74964@debbugs.gnu.org; Fri, 20 Dec 2024 11:21:18 -0500 Original-Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43624b2d453so22705215e9.2 for <74964@debbugs.gnu.org>; Fri, 20 Dec 2024 08:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734711612; x=1735316412; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ytGZ0nI53VBxEzcjd3viq0QEuZU3im5u1tYkU2H4xBc=; b=NyS5DIWGqEuPP+m2uqRi7Z/KJDzo50UTztUBS2RVLauRimkqk3wUaX1207HbLussZ1 phsAM59R9UOjh7F4i3T0rzkoWF9S/1wneZqA7OWA/3AQVAU096MBlGTujOBx68wm49op nnKLkPJ81SE0IP+CcuGsNg3n1FEuQzt4lOlHDxiSUgaQM6gbfR5Ht6i74aLmBuTxys22 H6wN2D9a5pnJR1mj3DoZIuAAKF/kz+UOSk1wVXtvJIkBPYKhAM23PF/wpwsyE+E9PraR PFEg9j+hUncZGKfBBxoi6ebr7MFNN8g5jtFU/1C/9j6hhqOwdXdlgRRYuhLkmvzhvd7n szMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734711612; x=1735316412; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ytGZ0nI53VBxEzcjd3viq0QEuZU3im5u1tYkU2H4xBc=; b=JU9Bh0+lFy/cH/ytXirv6Qe0/vhfdEJ9HGNZ0bilZUWQjbFGLcNbMI5x6WnzTeFS0n W1nMmVxyDDYeYSWZQvR1pel9V2ApTYhDVrE/al6bGTz0E0Za/sGxsEcL1rFjIbHhjKWJ ry/6HfKOfWIki+0IkiQbYgTuFUbvg1qUFwb019bO4i13gDbVTzNy4cwd2hgFULtEx2UF hTDeh0PrbjNpZbmkgd+jX82K0U+0JfRroN9+9p+LxtT4sp1WQwIaI4xfvdI2Kt8ik2sN x9WF8S8YjwMNrBQ8lLYaV85DlX8iK7eoOMuNXB3uSOi4QaW2Jmzg6d5qJkvmZjcuL2Ba 2qjg== X-Gm-Message-State: AOJu0Yx0/I15nlZlCks2EHiIiK1L4uYjO3qjfm3qEnsWGRQ/U8wO3WI2 4a686/+85TSmdbpqpTVs4KtqTl3vbs3VBNkpK5fDwzwmj6yM/o0t X-Gm-Gg: ASbGncuYsEoazG5bFGEpOEMctFbjdQf9/pGjFfTfeGwl+Dl1Aj72Q4CwUhLxSbRf0iZ +w4k/+tSm4kZseA6+9bnyRKGylMG4lpZlvFJaNu5qcRwL6QS5+/zO2TAHA3L7wLGsZrEO/5187H VyY8Kks4SHSBWYXu8joSCJvu9iphiXwPhLx0C5yAUjO4Ru5KLs/yg+gA57abDH6lxwjFJ2phKKD ui3XyywZygYGestjaFaNzQ1UqpzEK6n3bcgaRdQL4yX X-Google-Smtp-Source: AGHT+IHF7ouBlRFKoyQeX46hxigSLibzGetOCC0uzL4mMpELNZ4Q1dCr/3H6DcQqcHYkSHdxLXkTaQ== X-Received: by 2002:a05:600c:1c95:b0:434:a1d3:a321 with SMTP id 5b1f17b1804b1-4366835c1b0mr36967085e9.3.1734711611564; Fri, 20 Dec 2024 08:20:11 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:6b71:e408:124e:fe15]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656af6c4esm83710115e9.4.2024.12.20.08.20.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 08:20:11 -0800 (PST) In-Reply-To: (Yikai Zhao's message of "Thu, 19 Dec 2024 15:53:58 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297458 Archived-At: >>>>> On Thu, 19 Dec 2024 15:53:58 +0800, Yikai Zhao 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 --