From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Vinicius =?UTF-8?Q?Jos=C3=A9?= Latorre Newsgroups: gmane.emacs.bugs Subject: bug#39865: 28.0.50; Emacs crash Date: Thu, 12 Mar 2020 21:44:15 -0300 Message-ID: References: <83fteryy4o.fsf@gnu.org> <837dzyuf20.fsf@gnu.org> <83a74tbc9v.fsf@gnu.org> <83tv2w9sa3.fsf@gnu.org> <83a74makvy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008e4f8205a0b1c5b9" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="85270"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39865@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 13 01:45:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jCYRt-000LxD-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Mar 2020 01:45:13 +0100 Original-Received: from localhost ([::1]:52186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCYRs-0001qF-SW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Mar 2020 20:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51126) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCYRk-0001pp-7V for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 20:45:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCYRi-0006Ov-Fc for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 20:45:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCYRi-0006OL-CE for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 20:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jCYRi-0008Oj-A9 for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2020 20:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vinicius =?UTF-8?Q?Jos=C3=A9?= Latorre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Mar 2020 00:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 39865-submit@debbugs.gnu.org id=B39865.158406027732233 (code B ref 39865); Fri, 13 Mar 2020 00:45:02 +0000 Original-Received: (at 39865) by debbugs.gnu.org; 13 Mar 2020 00:44:37 +0000 Original-Received: from localhost ([127.0.0.1]:57955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCYRI-0008Nl-Cc for submit@debbugs.gnu.org; Thu, 12 Mar 2020 20:44:37 -0400 Original-Received: from mail-io1-f44.google.com ([209.85.166.44]:42859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCYRF-0008NV-B9 for 39865@debbugs.gnu.org; Thu, 12 Mar 2020 20:44:33 -0400 Original-Received: by mail-io1-f44.google.com with SMTP id q128so7671259iof.9 for <39865@debbugs.gnu.org>; Thu, 12 Mar 2020 17:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XuBuN818ndI/BwF8K42EFNhhf/3hg/PtMnhqzbZAYUo=; b=GaIEWl1YUdUNZrPg3yY+doVAH6UKnN0GEqgpRCjaJWm6zHBrKwklwTWYNaYPQQoQjK U0BxyGX1WVOf6jAlS9QOSc5pa7+U1ondN1wmCwC2pHaIFsy/0w0onAMWcEX7vbsX0Xu+ jtlErngVS9gp546VmujkJwW7obUPvYjIAZygOQGEXOdN2eQn4yqiMTIwPM6yUo+dgg90 2kPVpQzohkGXaoZvef1zr/5zSe6Vqif6h07p75DkTWho4+ZZMogFvCBA4qHJO2pDMmxO bgzxwAvO0sPgJoFnjgDXaM/OGlDDAou+qDcC4SDx/8ktpKY3p3RFufSMTpV4mESOWyCV d3wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XuBuN818ndI/BwF8K42EFNhhf/3hg/PtMnhqzbZAYUo=; b=Myxsc1JwDq0h1z9YaBaCxH7yOC9b7R8cxMPBFP0xBwaeC+d9aU3d8q7fV1C5a7Jium bepZjMIchTkSReMLpuPuQVXON3VXCjNHgL1P2iLD/0NImsh3S/5OqG8xmAb3r6b1xvsH DidR5quzpZXPF2frnXf7WBMfm3feGyaYcsui5yh+NYzqoNyULDiwFFNOO9e3Iqm0iHVV /+uGcQ2zPcFF1UIhczDgDFks30qtbjH4lDwPSCEVU3UHYbEHTkIBtkzp12knyFhOMewM dLBkzJNEKWChjX1B+Da+cLTvSm4835hrZf2dGyPk680KPggzdizJ6FNFqvwRvzwjg8PN VqOg== X-Gm-Message-State: ANhLgQ0xiiAmjhUhRUC6yzyyb/qil9dXw1BjdToRGgUOAL743RRQBu/z OMCgEu4EaoKsJPtTT14Bt7A7qTNXW10/1NOVUHg= X-Google-Smtp-Source: ADFU+vtOLrA/gWw5mEaOF7RTpB7vl6rXDs+IBjMw8d8cRzc17j3BPQ1UdFxFKspks4qjjgaYzN6nReb0tyw+EWVh7Do= X-Received: by 2002:a5d:8853:: with SMTP id t19mr10465880ios.21.1584060267645; Thu, 12 Mar 2020 17:44:27 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177242 Archived-At: --0000000000008e4f8205a0b1c5b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Vinicius, the following patch should fix things for you. I've just reinstalled with the fix, and I confirm that all works right when setting font-backend to xft. On Thu, Mar 12, 2020 at 7:25 AM Robert Pluim wrote: > >>>>> On Thu, 12 Mar 2020 10:33:00 +0100, Robert Pluim > said: > Robert> Of course, what I should do is rebase > Robert> > > Robert> Yep, that fixes this for me. Of course it breaks the macOS > build, > Robert> since that doesn=CA=BCt have a gui_default_font_parameter fun= ction > Robert> (yet :-) ). > > Vinicius, the following patch should fix things for you. I=CA=BCll have t= o > 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 =3D font_update_drivers (f, NILP (new_value) ? Qt : new_valu= e); > 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 =3D true; > windows_or_buffers_changed =3D 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 =3D FRAME_DISPLAY_INFO (f); > Lisp_Object font_param =3D 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); > --0000000000008e4f8205a0b1c5b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Vinicius, the following patch should fix things for y= ou.

I've just reinstalled with the fix, and I co= nfirm that all works right when setting font-backend to xft.

=


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

=C2=A0 =C2=A0 Robert> Yep, that fixes this for me. Of course it breaks t= he macOS build,
=C2=A0 =C2=A0 Robert> since that doesn=CA=BCt have a gui_default_font_pa= rameter function
=C2=A0 =C2=A0 Robert> (yet :-) ).

Vinicius, the following patch should fix things for you. I=CA=BCll have to<= br> 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)=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Lisp_Object, Lisp_Object,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0const char *, const char *,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0enum resource_types);
+extern void gui_default_font_parameter (struct frame *, Lisp_Object);

=C2=A0#ifndef HAVE_NS /* These both used on W32 and X only.=C2=A0 */
=C2=A0extern 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 n= ew_value, Lisp_Object old_va
=C2=A0 =C2=A0 =C2=A0return;

=C2=A0 =C2=A0if (FRAME_FONT (f))
-=C2=A0 =C2=A0 free_all_realized_faces (Qnil);
+=C2=A0 =C2=A0 {
+=C2=A0 =C2=A0 =C2=A0 Lisp_Object frame;
+=C2=A0 =C2=A0 =C2=A0 XSETFRAME (frame, f);
+=C2=A0 =C2=A0 =C2=A0 free_all_realized_faces (frame);
+=C2=A0 =C2=A0 }

=C2=A0 =C2=A0new_value =3D font_update_drivers (f, NILP (new_value) ? Qt : = new_value);
=C2=A0 =C2=A0if (NILP (new_value))
@@ -4579,10 +4583,8 @@ gui_set_font_backend (struct frame *f, Lisp_Object n= ew_value, Lisp_Object old_va

=C2=A0 =C2=A0if (FRAME_FONT (f))
=C2=A0 =C2=A0 =C2=A0{
-=C2=A0 =C2=A0 =C2=A0 Lisp_Object frame;
-
-=C2=A0 =C2=A0 =C2=A0 XSETFRAME (frame, f);
-=C2=A0 =C2=A0 =C2=A0 gui_set_font (f, Fframe_parameter (frame, Qfont), Qni= l);
+=C2=A0 =C2=A0 =C2=A0 /* Reconsider default font after backend(s) change (B= ug#23386).=C2=A0 */
+=C2=A0 =C2=A0 =C2=A0 gui_default_font_parameter (f, Qnil);
=C2=A0 =C2=A0 =C2=A0 =C2=A0face_change =3D true;
=C2=A0 =C2=A0 =C2=A0 =C2=A0windows_or_buffers_changed =3D 18;
=C2=A0 =C2=A0 =C2=A0}
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)
=C2=A0 =C2=A0unwind_create_frame (frame);
=C2=A0}

-static void
-x_default_font_parameter (struct frame *f, Lisp_Object parms)
+void
+gui_default_font_parameter (struct frame *f, Lisp_Object parms)
=C2=A0{
=C2=A0 =C2=A0struct x_display_info *dpyinfo =3D FRAME_DISPLAY_INFO (f);
=C2=A0 =C2=A0Lisp_Object font_param =3D gui_display_get_arg (dpyinfo, parms= , Qfont, NULL, NULL,
@@ -3894,7 +3894,7 @@ DEFUN ("x-create-frame", Fx_create_frame, S= x_create_frame,

=C2=A0 =C2=A0/* Extract the window parameters from the supplied values
=C2=A0 =C2=A0 =C2=A0 that are needed to determine window geometry.=C2=A0 */=
-=C2=A0 x_default_font_parameter (f, parms);
+=C2=A0 gui_default_font_parameter (f, parms);
=C2=A0 =C2=A0if (!FRAME_FONT (f))
=C2=A0 =C2=A0 =C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0delete_frame (frame, Qnoelisp);
@@ -6378,7 +6378,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, L= isp_Object parms)

=C2=A0 =C2=A0/* Extract the window parameters from the supplied values that= are
=C2=A0 =C2=A0 =C2=A0 needed to determine window geometry.=C2=A0 */
-=C2=A0 x_default_font_parameter (f, parms);
+=C2=A0 gui_default_font_parameter (f, parms);

=C2=A0 =C2=A0gui_default_parameter (f, parms, Qborder_width, make_fixnum (0= ),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "borderWidth", "BorderWidth", RES_TYP= E_NUMBER);
--0000000000008e4f8205a0b1c5b9--