GNU bug report logs - #60643
29.0.50; set-buffer-major-mode resets buffer local variables

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Sun, 8 Jan 2023 04:58:01 UTC

Severity: normal

Found in version 29.0.50

Done: Joseph Turner <joseph <at> breatheoutbreathe.in>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 60643 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Eli Zaretskii <eliz <at> gnu.org>, ruijie <at> netyu.xyz
Cc: 60643 <at> debbugs.gnu.org
Subject: Re: bug#60643: 29.0.50; set-buffer-major-mode resets buffer local
 variables
Date: Sun, 08 Jan 2023 01:09:55 -0800
Hello!

Eli Zaretskii <eliz <at> gnu.org> writes:

> 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.

Ruijie Yu <ruijie <at> netyu.xyz> writes:

> 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.

Thank you both for your help!! This solves it:

(put 'test-var 'permanent-local t)

Joseph




This bug report was last modified 2 years and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.