unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 62275@debbugs.gnu.org
Subject: bug#62275: 28.2; Changing major mode changes the current text scaling
Date: Sun, 19 Mar 2023 16:03:26 +0000	[thread overview]
Message-ID: <SJ0PR10MB548886C751FB38990D90A92EF3839@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)

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)






             reply	other threads:[~2023-03-19 16:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 16:03 Drew Adams [this message]
2023-03-19 16:47 ` bug#62275: 28.2; Changing major mode changes the current text scaling Eli Zaretskii
2023-03-19 17:22   ` Drew Adams
2023-03-19 17:40     ` Eli Zaretskii
2023-03-19 21:50       ` Drew Adams
2023-03-20 11:58         ` Eli Zaretskii
2023-03-20 16:19           ` Drew Adams
2023-03-20 17:00             ` Eli Zaretskii
2023-03-20 17:24               ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB548886C751FB38990D90A92EF3839@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=62275@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).