unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39865@debbugs.gnu.org, viniciusjl@gmail.com
Subject: bug#39865: 28.0.50; Emacs crash
Date: Thu, 12 Mar 2020 11:25:06 +0100	[thread overview]
Message-ID: <m2v9n9eupp.fsf@gmail.com> (raw)
In-Reply-To: <m2a74lc3zn.fsf@gmail.com> (Robert Pluim's message of "Thu, 12 Mar 2020 10:33:00 +0100")

>>>>> On Thu, 12 Mar 2020 10:33:00 +0100, Robert Pluim <rpluim@gmail.com> said:
    Robert> Of course, what I should do is rebase
    Robert> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23386#43>

    Robert> Yep, that fixes this for me. Of course it breaks the macOS build,
    Robert> since that doesnʼt have a gui_default_font_parameter function
    Robert> (yet :-) ).

Vinicius, the following patch should fix things for you. Iʼll have to
look at what's needed on the macOS side.

diff --git a/src/dispextern.h b/src/dispextern.h
index 6246c7c080..f08231f071 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3726,6 +3726,7 @@ #define IMAGE_BACKGROUND_TRANSPARENT(img, f, mask)			      \
                                           Lisp_Object, Lisp_Object,
                                           const char *, const char *,
                                           enum resource_types);
+extern void gui_default_font_parameter (struct frame *, Lisp_Object);
 
 #ifndef HAVE_NS /* These both used on W32 and X only.  */
 extern bool gui_mouse_grabbed (Display_Info *);
diff --git a/src/frame.c b/src/frame.c
index 51fc78ab70..45fed8420c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4565,7 +4565,11 @@ gui_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_va
     return;
 
   if (FRAME_FONT (f))
-    free_all_realized_faces (Qnil);
+    {
+      Lisp_Object frame;
+      XSETFRAME (frame, f);
+      free_all_realized_faces (frame);
+    }
 
   new_value = font_update_drivers (f, NILP (new_value) ? Qt : new_value);
   if (NILP (new_value))
@@ -4579,10 +4583,8 @@ gui_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_va
 
   if (FRAME_FONT (f))
     {
-      Lisp_Object frame;
-
-      XSETFRAME (frame, f);
-      gui_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
+      /* Reconsider default font after backend(s) change (Bug#23386).  */
+      gui_default_font_parameter (f, Qnil);
       face_change = true;
       windows_or_buffers_changed = 18;
     }
diff --git a/src/xfns.c b/src/xfns.c
index 5758bb7a18..ab013d85d8 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3555,8 +3555,8 @@ do_unwind_create_frame (Lisp_Object frame)
   unwind_create_frame (frame);
 }
 
-static void
-x_default_font_parameter (struct frame *f, Lisp_Object parms)
+void
+gui_default_font_parameter (struct frame *f, Lisp_Object parms)
 {
   struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
   Lisp_Object font_param = gui_display_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
@@ -3894,7 +3894,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
 
   /* Extract the window parameters from the supplied values
      that are needed to determine window geometry.  */
-  x_default_font_parameter (f, parms);
+  gui_default_font_parameter (f, parms);
   if (!FRAME_FONT (f))
     {
       delete_frame (frame, Qnoelisp);
@@ -6378,7 +6378,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, Lisp_Object parms)
 
   /* Extract the window parameters from the supplied values that are
      needed to determine window geometry.  */
-  x_default_font_parameter (f, parms);
+  gui_default_font_parameter (f, parms);
 
   gui_default_parameter (f, parms, Qborder_width, make_fixnum (0),
                          "borderWidth", "BorderWidth", RES_TYPE_NUMBER);





  reply	other threads:[~2020-03-12 10:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02  1:39 bug#39865: 28.0.50; Emacs crash Vinicius José Latorre
2020-03-02  8:11 ` Eli Zaretskii
2020-03-05  1:03   ` Vinicius José Latorre
2020-03-05 22:21     ` Vinicius José Latorre
2020-03-06  7:18       ` Eli Zaretskii
2020-03-06 17:20         ` Vinicius José Latorre
2020-03-06 17:24           ` Vinicius José Latorre
2020-03-06 17:53           ` Eli Zaretskii
2020-03-10 14:29             ` Robert Pluim
2020-03-10 14:52               ` Eli Zaretskii
2020-03-10 14:54                 ` Vinicius José Latorre
2020-03-10 15:20                   ` Robert Pluim
2020-03-10 19:03                     ` Vinicius José Latorre
2020-03-11  7:33                       ` Robert Pluim
2020-03-11 20:45                         ` Vinicius José Latorre
2020-03-12  9:39                           ` Robert Pluim
2020-03-10 15:15                 ` Robert Pluim
2020-03-11 16:58                   ` Eli Zaretskii
2020-03-12  9:33                     ` Robert Pluim
2020-03-12 10:25                       ` Robert Pluim [this message]
2020-03-13  0:44                         ` Vinicius José Latorre
2020-03-13  9:35                           ` Robert Pluim
2020-03-13 14:09                             ` Eli Zaretskii
2020-03-13 15:09                               ` Robert Pluim
2020-03-17 10:16                                 ` Robert Pluim
2020-03-17 15:15                                   ` Eli Zaretskii
2020-03-17 16:06                                     ` Robert Pluim

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=m2v9n9eupp.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=39865@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=viniciusjl@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 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).