From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60643: 29.0.50; set-buffer-major-mode resets buffer local variables Date: Sat, 07 Jan 2023 23:45:52 -0600 Message-ID: References: <87eds5r5d4.fsf@breatheoutbreathe.in> Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="474"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.13; emacs 29.0.60 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 06:51:09 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 1pEOaL-000ARf-5u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 06:51:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEOaG-0008Dw-Kl; Sun, 08 Jan 2023 00:51: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 1pEOaE-0008DC-Uq for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 00:51: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 1pEOaE-0002Rw-Gs for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 00:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEOaE-00042N-85 for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2023 00:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 05:51: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.167315700315436 (code B ref 60643); Sun, 08 Jan 2023 05:51:02 +0000 Original-Received: (at 60643) by debbugs.gnu.org; 8 Jan 2023 05:50:03 +0000 Original-Received: from localhost ([127.0.0.1]:59636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEOZG-00040r-Dh for submit@debbugs.gnu.org; Sun, 08 Jan 2023 00:50:03 -0500 Original-Received: from netyu.xyz ([152.44.41.246]:54860 helo=mail.netyu.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEOZD-00040F-61 for 60643@debbugs.gnu.org; Sun, 08 Jan 2023 00:50:01 -0500 Original-Received: from fw.net.yu.netyu.xyz (99-87-204-218.lightspeed.irvnca.sbcglobal.net [99.87.204.218]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 252fa267 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 8 Jan 2023 05:49:58 +0000 (UTC) In-reply-to: <87eds5r5d4.fsf@breatheoutbreathe.in> 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:252866 Archived-At: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hello! > > 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? > > Thank you!! > > Joseph > > In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.24.30, cairo version 1.16.0) > Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 > System Description: Debian GNU/Linux 11 (bullseye) > > Configured using: > 'configure > CONFIG_SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash > SHELL=/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash > --prefix=/gnu/store/4mnib031vflf88ms8w7kyfahcbv1k9vc-emacs-next-29.0.50-3.22e8a77 > --enable-fast-install --with-modules --with-cairo > --with-native-compilation --disable-build-details' > > Configured features: > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG > JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES > NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 > THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB There is another concept called "permanent local variables" which you might be thinking about when looking at "local variables", see info node `(elisp) Standard Properties' for more information. Best, RY