bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62275: 28.2; Changing major mode changes the current text scaling


From: Eli Zaretskii
Subject: bug#62275: 28.2; Changing major mode changes the current text scaling
Date: Sun, 19 Mar 2023 18:47:22 +0200

> From: Drew Adams <drew.adams@oracle.com>
> Date: Sun, 19 Mar 2023 16:03:26 +0000
> 
> emacs -Q
> 
> Use the mouse (with `C-') or keys to text-scale the buffer, e.g., to
> enlarge the text size.
> 
> M-x emacs-lisp-mode
> 
> The text in the buffer (*scratch*) is resized back to its original size.
> Should that happen?  If so, why - is that the right behavior?

Face remapping is a buffer-local behavior, and changing the major mode
kills all local variables.

> In addition, if you then do `M-x lisp-interaction-mode', the text size
> doesn't change back to the size you had scaled it to previously.

See above: the text-scale is not specific to the mode, it is a
buffer-local behavior, and modes have no memory of what that scaling
was.

> I can guess that this is happening because changing the mode kills all
> local variables.  But is this the intended behavior, i.e., what we want?

It isn't clear why we won't want that.

> I tried doing this, but it didn't fix the behavior.
> 
> (put 'text-scale-mode-remapping 'permanent-local t)
> (put 'text-scale-mode-lighter 'permanent-local t)
> (put 'text-scale-mode-amount 'permanent-local t)

You need to do this with face-remapping-alist.

> If there's (also) a good use case for the current behavior then maybe we
> could have a user option, to choose whether a major-mode change resets
> the text scale?

Sounds like creeping featurism to me.  If you want the text size
larger, then why not customize the default face, and have that done
once and for all?  Text-scale is by definition a temporary measure.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]