From: Gregory Heytings <gregory@heytings.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 59122@debbugs.gnu.org, "Rudolf Adamkovič" <salutis@me.com>
Subject: bug#59122: 29.0.50; global-text-scale-adjust not working
Date: Sun, 13 Nov 2022 09:18:00 +0000 [thread overview]
Message-ID: <1a8c89f83eba3c0b711c@heytings.org> (raw)
In-Reply-To: <CADwFkm=syR4N6jX0erngtsPbD=Jb6jrS9vr1Qbbjepa9swn90g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 622 bytes --]
>
> I guess the idea is that you should invoke it with `C-x C-M-0'? But
> that seems to have another problem with the patch - when I type it I
> get:
>
Thanks. This bug is fixed in the attached patch.
>> Also, the two function now scale super-duper differently. :-/
>
> Do you mean 'text-scale-adjust' and 'global-text-scale-adjust'? I see
> the same here.
>
Yes. As I said earlier, global-text-scale-adjust scales smoothly, and
text-scale-adjust scales fast. That was a design choice when implementing
global-text-scale-adjust. It should of course be possible to make
text-scale-adjust scale smoothly too.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix-global-face-scaling-bug-due-to-rounding.patch --]
[-- Type: text/x-diff; name=Fix-global-face-scaling-bug-due-to-rounding.patch, Size: 2451 bytes --]
From 3a277b9756499a392b70b74324e4e746b0ae066d Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Sun, 13 Nov 2022 09:14:03 +0000
Subject: [PATCH] Fix global face scaling bug due to rounding.
* lisp/face-remap.el (global-text-scale-adjust): Try again if the face
height should have changed but did not actually change.
(global-text-scale-adjust--increment-factor): New internal variable.
Fixes bug#59122.
---
lisp/face-remap.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 432385587b..33ffb41ec9 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -461,6 +461,8 @@ global-text-scale-adjust-limits
(defvar global-text-scale-adjust--default-height nil)
+(defvar global-text-scale-adjust--increment-factor 5)
+
;;;###autoload (define-key ctl-x-map [(control meta ?+)] 'global-text-scale-adjust)
;;;###autoload (define-key ctl-x-map [(control meta ?=)] 'global-text-scale-adjust)
;;;###autoload (define-key ctl-x-map [(control meta ?-)] 'global-text-scale-adjust)
@@ -499,16 +501,24 @@ global-text-scale-adjust
(cur (face-attribute 'default :height))
(inc
(pcase key
- (?- (* (- increment) 5))
+ (?- (* (- increment)
+ global-text-scale-adjust--increment-factor))
(?0 (- global-text-scale-adjust--default-height cur))
- (_ (* increment 5))))
+ (_ (* increment
+ global-text-scale-adjust--increment-factor))))
(new (+ cur inc)))
(when (< (car global-text-scale-adjust-limits)
new
(cdr global-text-scale-adjust-limits))
(let ((frame-inhibit-implied-resize
(not global-text-scale-adjust-resizes-frames)))
- (set-face-attribute 'default nil :height new)))
+ (set-face-attribute 'default nil :height new)
+ (redisplay 'force)
+ (when (and (not (= key ?0))
+ (= cur (face-attribute 'default :height)))
+ (setq global-text-scale-adjust--increment-factor
+ (1+ global-text-scale-adjust--increment-factor))
+ (global-text-scale-adjust increment))))
(when (characterp key)
(set-transient-map
(let ((map (make-sparse-keymap)))
--
2.35.1
next prev parent reply other threads:[~2022-11-13 9:18 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 12:28 bug#59122: 29.0.50; global-text-scale-adjust not working Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-08 12:42 ` Eli Zaretskii
2022-11-08 12:47 ` Gregory Heytings
2022-11-08 21:48 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-09 3:33 ` Eli Zaretskii
2022-11-09 10:00 ` Gregory Heytings
2022-11-09 13:28 ` Stefan Kangas
2022-11-09 13:39 ` Gregory Heytings
2022-11-09 14:30 ` Stefan Kangas
2022-11-09 14:36 ` Robert Pluim
2022-11-09 14:43 ` Stefan Kangas
2022-11-09 14:48 ` Robert Pluim
2022-11-09 14:47 ` Gregory Heytings
2022-11-09 14:59 ` Stefan Kangas
2022-11-09 15:20 ` Robert Pluim
2022-11-09 14:36 ` Gregory Heytings
2022-11-09 14:51 ` Eli Zaretskii
2022-11-09 14:59 ` Eli Zaretskii
2022-11-09 15:25 ` Robert Pluim
2022-11-09 16:02 ` Gregory Heytings
2022-11-09 16:55 ` Eli Zaretskii
2022-11-10 0:44 ` Stefan Kangas
2022-11-10 7:56 ` Eli Zaretskii
2022-11-09 16:01 ` Gregory Heytings
2022-11-09 16:53 ` Eli Zaretskii
2022-11-09 16:18 ` Gregory Heytings
2022-11-10 0:26 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 8:33 ` Gregory Heytings
2022-11-10 16:16 ` Stefan Kangas
2022-11-10 17:00 ` Gregory Heytings
2022-11-11 16:05 ` Stefan Kangas
2022-11-13 0:23 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-13 3:05 ` Stefan Kangas
2022-11-13 6:59 ` Eli Zaretskii
2022-11-13 13:06 ` Stefan Kangas
2022-11-13 9:18 ` Gregory Heytings [this message]
2022-11-13 13:48 ` Stefan Kangas
2022-11-13 16:33 ` Eli Zaretskii
2022-11-13 19:39 ` Gregory Heytings
2022-11-13 20:09 ` Eli Zaretskii
2022-11-19 15:52 ` Gregory Heytings
2022-11-13 6:57 ` Eli Zaretskii
2022-11-13 9:10 ` Gregory Heytings
2022-11-13 22:37 ` Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-14 0:00 ` Stephen Berman
2022-11-14 3:31 ` Eli Zaretskii
2022-11-09 13:40 ` Eli Zaretskii
2022-11-09 14:35 ` Stefan Kangas
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a8c89f83eba3c0b711c@heytings.org \
--to=gregory@heytings.org \
--cc=59122@debbugs.gnu.org \
--cc=salutis@me.com \
--cc=stefankangas@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.