--- Begin Message ---
Subject: |
28.2; Changing major mode changes the current text scaling |
Date: |
Sun, 19 Mar 2023 16:03:26 +0000 |
Maybe this is intended and documented somewhere - if so, feel free to
close it. I haven't seen it mentioned, and it doesn't seem right to me.
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?
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.
Text-scaling is per buffer, and the buffer hasn't changed. Only the
major mode has changed.
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?
As a user, I find this unexpected (even a bit annoying). I think users
will (and should) think of text-scaling as per buffer, not something
that's affected by changing the major mode.
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)
Haven't tried to understand what's really going on - just reporting that
the behavior seems odd to me.
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?
In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
of 2022-09-13 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.2604)
Configured using:
'configure --with-modules --without-dbus --with-native-compilation
--without-compress-install CFLAGS=-O2'
Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB
(NATIVE_COMP present but libgccjit not available)
--- End Message ---
--- Begin Message ---
Subject: |
Re: [External] : Re: bug#62275: 28.2; Changing major mode changes the current text scaling |
Date: |
Mon, 20 Mar 2023 19:00:37 +0200 |
> From: Drew Adams <drew.adams@oracle.com>
> CC: "62275@debbugs.gnu.org" <62275@debbugs.gnu.org>
> Date: Mon, 20 Mar 2023 16:19:22 +0000
>
> > > > But that's what text-scaling does: it enlarges
> > > > the default face's font.
> > >
> > > You seem to be dancing around this.
> >
> > Why the sarcasm/insult? I don't have to have this conversation, and I
> > certainly won't if you keep this attitude.
>
> There's neither any sarcasm nor any insult there.
> You're apparently seeing what you want to see.
> Why do that?
I definitely wasn't "dancing".
> > > Text-scaling does NOT "customize the default face".
> >
> > Of course, it does.
>
> For some meaning of "customize", perhaps. I didn't
> see any use of any `custom*' functions. But I may
> not have read the code carefully enough.
Customization in our terminology doesn't necessarily mean one has to
use "M-x customize-SOMETHING". A simple setq can also be a
customization, as well as some others.
> > Yes, as expected. Text-scaling, by contrast, is a buffer-local
> > behavior, and buffer-local behaviors get reset when the major mode
> > changes.
>
> I think you're confirming what I said. Text-scaling
> doesn't just change face `default' for a given frame.
Text-scaling is a buffer-local change of a face.
> > > These are different things: (1) zooming a buffer
> > > (everywhere) and (2) zooming a frame (all its
> > > windows, whatever the buffers) and zooming
> > > nothing in any other frame.
> >
> > Not very different, since we now have
> > global-text-scale-adjust and friends.
>
> Interesting. I know nothing about such a command.
> I don't see it in Emacs 28.2 (the latest release).
It's new in Emacs 29.
> Does it zoom all windows (any buffers) in a frame?
> Does it zoom only the current frame?
It affects all faces on all frames.
> At any rate, feel free to close this bug
Done.
--- End Message ---