Subject: Re: bug#60643: 29.0.50; set-buffer-major-mode resets buffer local variables

From: Joseph Turner <[email-masked]>
Date: Sun, 08 Jan 2023 01:09:55 -0800

Hello!

Eli Zaretskii <[email-masked]> 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 <[email-masked]> 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