emacs-diffs
[Top][All Lists]
Advanced

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

master aa25a38f2c: Fix the startup.el behavior when 'face-font-rescale-a


From: Eli Zaretskii
Subject: master aa25a38f2c: Fix the startup.el behavior when 'face-font-rescale-alist' is non-nil
Date: Sun, 10 Jul 2022 04:34:03 -0400 (EDT)

branch: master
commit aa25a38f2c4a67a39e84bed3cfea73fa366f2db4
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix the startup.el behavior when 'face-font-rescale-alist' is non-nil
    
    * lisp/startup.el (command-line-1, normal-top-level): Reset the
    default face's font only if 'face-font-rescale-alist' affects that
    face's font.  For the use case where it matters, see
    https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00157.html.
    Make the 'inhibit-startup-screen' and non-inhibit branches behave
    the same in that case.
---
 lisp/startup.el | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index 4b42cd236c..45b99eb893 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -800,10 +800,12 @@ It is the default value of the variable `top-level'."
          ;; face-font-rescale-alist into account.  For such
          ;; situations, we ought to have a way to find all font
          ;; objects and regenerate them; currently we do not.  As a
-         ;; workaround, we specifically reset te default face's :font
-         ;; attribute here.  See bug#1785.
-         (unless (eq face-font-rescale-alist
-                     old-face-font-rescale-alist)
+         ;; workaround, we specifically reset the default face's :font
+         ;; attribute here, if it was rescaled.  See bug#1785.
+         (when (and (not (eq face-font-rescale-alist
+                             old-face-font-rescale-alist))
+                     (assoc (font-xlfd-name (face-attribute 'default :font))
+                            face-font-rescale-alist #'string-match-p))
            (set-face-attribute 'default nil :font (font-spec)))
 
          ;; Modify the initial frame based on what .emacs puts into
@@ -2840,6 +2842,14 @@ nil default-directory" name)
         ;; before doing any output.
         (run-hooks 'emacs-startup-hook 'term-setup-hook)
 
+        ;; See the commentary in `normal-top-level' for why we do
+        ;; this.
+       (when (and (not (eq face-font-rescale-alist
+                           old-face-font-rescale-alist))
+                   (assoc (font-xlfd-name (face-attribute 'default :font))
+                          face-font-rescale-alist #'string-match-p))
+         (set-face-attribute 'default nil :font (font-spec)))
+
         ;; It's important to notice the user settings before we
         ;; display the startup message; otherwise, the settings
         ;; won't take effect until the user gives the first



reply via email to

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