From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60643: 29.0.50; set-buffer-major-mode resets buffer local variables Date: Sun, 08 Jan 2023 08:00:11 +0200 Message-ID: <83ilhhr2fo.fsf@gnu.org> References: <87eds5r5d4.fsf@breatheoutbreathe.in> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60643@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 08 07:00:10 2023 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 1pEOj4-000AOr-2V for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 07:00:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEOiy-0001jg-FZ; Sun, 08 Jan 2023 01:00:04 -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 1pEOiw-0001jW-S5 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 01:00:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEOiw-0006tD-Gs for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 01:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEOiw-0004Hd-C1 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 01:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 06:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60643 X-GNU-PR-Package: emacs Original-Received: via spool by 60643-submit@debbugs.gnu.org id=B60643.167315759716426 (code B ref 60643); Sun, 08 Jan 2023 06:00:02 +0000 Original-Received: (at 60643) by debbugs.gnu.org; 8 Jan 2023 05:59:57 +0000 Original-Received: from localhost ([127.0.0.1]:59654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEOir-0004Gs-7o for submit@debbugs.gnu.org; Sun, 08 Jan 2023 00:59:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEOip-0004Gf-Qi for 60643@debbugs.gnu.org; Sun, 08 Jan 2023 00:59:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEOij-0006rO-H8; Sun, 08 Jan 2023 00:59:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QYOHHSK9wPSX3W8DHqG67Ak1MhRyFGXj0f79XVxcjY0=; b=G6svpq5xHCLq Q5wIHPbEbnRM3CkSPzNyyWU2eM8mLPuCsLPEdNYgwNWFDe/RjvSZT//9qlEe12JwEdgbwqLiULJak lAM/X/Y2657mfF9zYyPGWcyRY8QSiljM2yahig+p4grOH5dCPLSsXpQfliHmAcNIi8XkExZdZcieE ZAqeu9Zv49oY3baAULJh/9XEB7ca7Ho4xyrO1Saw4LUR+v5Erk+qq1kZXQTaaIbJ0t53RIlOAi3/T MtZHQYqd+N0JDPSmfjJJ/uI4dySi5WDvIE9NI9m1EviAGlgaAyRjO8hTPn+qxuAwBGyloZkowCk+n dGNggImNQ9uIHx82z4ECrQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEOii-0006pZ-3t; Sun, 08 Jan 2023 00:59:49 -0500 In-Reply-To: <87eds5r5d4.fsf@breatheoutbreathe.in> (bug-gnu-emacs@gnu.org) 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:252869 Archived-At: > Date: Sat, 07 Jan 2023 20:48:54 -0800 > From: Joseph Turner via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > It appears that set-buffer-major-mode resets buffer local variables. > > To reproduce with `emacs -Q`: > > (defvar-local test-var nil) > (setq test-var t) > (message "%s" test-var) ;; t > ;; (set-auto-mode) > (set-buffer-major-mode (current-buffer)) > (message "%s" test-var) ;; nil > > Is this behavior expected? Yes, I think so. Changing the major mode kills all buffer-local variables. If you don't want some variable to be killed, give it the permanent-local property.