From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#39865: 28.0.50; Emacs crash Date: Fri, 13 Mar 2020 10:35:14 +0100 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: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="111713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39865@debbugs.gnu.org To: Vinicius =?UTF-8?Q?Jos=C3=A9?= Latorre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 13 10:36:15 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 1jCgjn-000Sy0-2r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Mar 2020 10:36:15 +0100 Original-Received: from localhost ([::1]:56080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCgjm-0006mZ-0T for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Mar 2020 05:36:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48509) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCgjb-0006cN-NX for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 05:36:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCgja-0001zT-79 for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 05:36:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCgjZ-0001xc-Vt for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 05:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jCgjZ-0003Bt-Rn for bug-gnu-emacs@gnu.org; Fri, 13 Mar 2020 05:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Mar 2020 09:36:01 +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.158409212612205 (code B ref 39865); Fri, 13 Mar 2020 09:36:01 +0000 Original-Received: (at 39865) by debbugs.gnu.org; 13 Mar 2020 09:35:26 +0000 Original-Received: from localhost ([127.0.0.1]:58139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCgiz-0003Ak-Kl for submit@debbugs.gnu.org; Fri, 13 Mar 2020 05:35:26 -0400 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:33685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCgiy-0003AV-7I for 39865@debbugs.gnu.org; Fri, 13 Mar 2020 05:35:24 -0400 Original-Received: by mail-wr1-f65.google.com with SMTP id a25so11180378wrd.0 for <39865@debbugs.gnu.org>; Fri, 13 Mar 2020 02:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=7QPftLiHTJIXGayyHbzNP1si98keK8kkGOdutATrRko=; b=cAF2PXROQqFm+OU+weP7SZRJxxH2D8STo1nNzm1DlB3iuOpuYRUrr1em8FsvwQlqJl FzmqKpZHAiwr61WBHJfbxrVeoMJauOLERY3NKFA2n6jvHtFK9y2T8BvC5FaWkZMcdPvZ RvvyD/giMGgEQF0dbHB0W0Nae3eM8dymumMowUimx73utVESDQnuJEHxgq81p1D3qU9Z NjLDR8LBQ+KiCmaXSySJlGl8ONJG186vVlN5aSg/mES135s0e9sQW2KBoj/gEkEaBp9t iCCsdSe+D/aFxFR2rJly6Dv1W++SmWrLD1AIKCQt4jnsS8Oil+5jG8E1e1nhfL70/tYv Qqrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=7QPftLiHTJIXGayyHbzNP1si98keK8kkGOdutATrRko=; b=cwZiUlrXiwp3tfG2N+G8UPSJh5GohsI9+kXWjE+gGu1m8nOSYulz29Q9Bm2jo2+yma aWcse+LMRDT9xM7NW4kYLTPsRDwKenf5hytTpUzMbXly6L22ef6qrblgX6mv5pMTb0fx ymXhEBxCKDYbiQAbKfZaP/PljBWAPjGZo0uohPvSKLUZMLg+1cHNnwP7NdG6I8/25ozv R5yZczm2kNhC9elczYjChJecOgEnWkkLTPBDRVLqqNa932iIc46Avnyz498heCZhY973 u1IV0edxkqVTMYPKFNogB/jeHJ7BFKOgK0gTdWmXQGs1uP4nf80mfVelYAlFHGaQTCit M3Vw== X-Gm-Message-State: ANhLgQ14LFm9/OZlrPp+bXitB9LqG+euKndFSAEDCvXsomfPdp3y1i3Q WJJwEsaXlD+jSL/Nh6VBYYzgr5fF X-Google-Smtp-Source: ADFU+vvrTYMDfJG0IDSGX02ssNhpNAWVmgt2opTokOQ2GR4+HYRNkEtwUjiqSSs/yXOtKKhDdKCi+A== X-Received: by 2002:a5d:6884:: with SMTP id h4mr16525254wru.91.1584092117818; Fri, 13 Mar 2020 02:35:17 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:c53c:2564:ad79:e8dc]) by smtp.gmail.com with ESMTPSA id x13sm16534995wmj.5.2020.03.13.02.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 02:35:16 -0700 (PDT) In-Reply-To: ("Vinicius =?UTF-8?Q?Jos=C3=A9?= Latorre"'s message of "Thu, 12 Mar 2020 21:44:15 -0300") 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:177257 Archived-At: >>>>> On Thu, 12 Mar 2020 21:44:15 -0300, Vinicius Jos=C3=A9 Latorre said: >> Vinicius, the following patch should fix things for you. Vinicius> I've just reinstalled with the fix, and I confirm that all wo= rks right when Vinicius> setting font-backend to xft. Thanks for testing. Eli, the patch as it stands is not suitable for pushing to emacs-27, since it breaks the macOS build, which doesn=CA=BCt have a gui_default_font_parameter function. As far as I can tell (and have tested :-) ), we can get away with a dummy one, since there is only one font backend on macOS. If you agree, this is what the complete patch looks like: 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); =20 #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 n= ew_value, Lisp_Object old_va return; =20 if (FRAME_FONT (f)) - free_all_realized_faces (Qnil); + { + Lisp_Object frame; + XSETFRAME (frame, f); + free_all_realized_faces (frame); + } =20 new_value =3D 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 n= ew_value, Lisp_Object old_va =20 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/nsfns.m b/src/nsfns.m index cbde93b3f1..b7f6813e4f 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1447,6 +1447,14 @@ Turn the input menu (an NSMenu) into a lisp list for= tracking on lisp side. return unbind_to (count, frame); } =20 +/* This currently does nothing, since it's only really needed when + changing the font-backend, but macOS currently only has one + possible backend. */ +void +gui_default_font_parameter (struct frame *f, Lisp_Object parms) +{ +} + static BOOL ns_window_is_ancestor (NSWindow *win, NSWindow *candidate) /* Test whether CANDIDATE is an ancestor window of WIN. */ diff --git a/src/w32fns.c b/src/w32fns.c index 61e22e5700..c09e14d354 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5749,8 +5749,8 @@ do_unwind_create_frame (Lisp_Object frame) unwind_create_frame (frame); } =20 -static void -w32_default_font_parameter (struct frame *f, Lisp_Object parms) +void +gui_default_font_parameter (struct frame *f, Lisp_Object parms) { struct w32_display_info *dpyinfo =3D FRAME_DISPLAY_INFO (f); Lisp_Object font_param =3D gui_display_get_arg (dpyinfo, @@ -5978,7 +5978,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_f= rame, =20 /* Extract the window parameters from the supplied values that are needed to determine window geometry. */ - w32_default_font_parameter (f, parameters); + gui_default_font_parameter (f, parameters); =20 /* Default BorderWidth to 0 to match other platforms. */ gui_default_parameter (f, parameters, Qborder_width, make_fixnum (0), @@ -7039,7 +7039,7 @@ w32_create_tip_frame (struct w32_display_info *dpyinf= o, Lisp_Object parms) =20 /* Extract the window parameters from the supplied values that are needed to determine window geometry. */ - w32_default_font_parameter (f, parms); + gui_default_font_parameter (f, parms); =20 gui_default_parameter (f, parms, Qborder_width, make_fixnum (2), "borderWidth", "BorderWidth", RES_TYPE_NUMBER); 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); } =20 -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, N= ULL, NULL, @@ -3894,7 +3894,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_f= rame, =20 /* 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, L= isp_Object parms) =20 /* 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); =20 gui_default_parameter (f, parms, Qborder_width, make_fixnum (0), "borderWidth", "BorderWidth", RES_TYPE_NUMBER);