all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: "Rudolf Adamkovič" <salutis@me.com>, 59122@debbugs.gnu.org
Subject: bug#59122: 29.0.50; global-text-scale-adjust not working
Date: Wed, 09 Nov 2022 16:18:32 +0000	[thread overview]
Message-ID: <5e251f240fa01277a76a@heytings.org> (raw)
In-Reply-To: <CADwFkmmOvCXMJQO9_Us_hZe1DW2+JGqyVEip1W7gUBEoFugKLA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 88 bytes --]


Stefan, Rudolf, can you try the attached patch and see if it fixes the 
issue?

Thanks.

[-- 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: 2347 bytes --]

From 288401146162e67efa8f4a23c790fadeb1b92d6a Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Wed, 9 Nov 2022 16:16:22 +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 did not actually change.
(global-text-scale-adjust--increment-factor): New internal variable.
Fixes bug#59122.
---
 lisp/face-remap.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 432385587b..2d83d804c6 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,22 @@ 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)
+          (when (= 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


  parent reply	other threads:[~2022-11-09 16: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 [this message]
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
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=5e251f240fa01277a76a@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.