From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48408: BUGFIX: window-default-font-height: check for nil string Date: Fri, 14 May 2021 09:39:18 +0300 Message-ID: <83mtsxzund.fsf@gnu.org> References: <20210514011519.vsy5jbhyxd4v6kpt@E15-2016.optimum.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24350"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48408@debbugs.gnu.org To: Boruch Baum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 08:40:13 2021 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 1lhRUa-0006BN-Nv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 08:40:12 +0200 Original-Received: from localhost ([::1]:56448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhRUX-0004Zf-JY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 02:40:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhRUQ-0004Y3-3Y for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 02:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33243) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhRUP-0007PE-Rb for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 02:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhRUP-00067L-OT for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 02:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 06:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48408 X-GNU-PR-Package: emacs Original-Received: via spool by 48408-submit@debbugs.gnu.org id=B48408.162097435123445 (code B ref 48408); Fri, 14 May 2021 06:40:01 +0000 Original-Received: (at 48408) by debbugs.gnu.org; 14 May 2021 06:39:11 +0000 Original-Received: from localhost ([127.0.0.1]:44789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhRTa-000665-M6 for submit@debbugs.gnu.org; Fri, 14 May 2021 02:39:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhRTZ-00065t-P2 for 48408@debbugs.gnu.org; Fri, 14 May 2021 02:39:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44438) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhRTU-0006op-Bs; Fri, 14 May 2021 02:39:04 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3522 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhRTT-0005FB-K5; Fri, 14 May 2021 02:39:04 -0400 In-Reply-To: <20210514011519.vsy5jbhyxd4v6kpt@E15-2016.optimum.net> (message from Boruch Baum on Thu, 13 May 2021 21:15:19 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:206481 Archived-At: > Date: Thu, 13 May 2021 21:15:19 -0400 > From: Boruch Baum > > In package windows.el, function `window-default-font-height' calls > function `face-font', which can return a nil value, but performs a > `string-equal' operation on the output without checking for that > possibiliy. > > I came across this in an unusual case, of having an 'emacs -nw' server > an 'emacsclient -nw', and opening a GUI emacsclient to connect to it. > From that point forward until the fix, every *second* attempt to use the > minibuffer on the 'emacsclient -nw' would fail. This means the problem is either in window-normalize-window or in frame-parameter or in display-graphic-p, and should be fixed there. Can you tell what does the below produce on the TTY frame where you have this problem? M-: (frame-parameter nil 'display) RET M-: (window-frame (window-normalize-window nil t)) RET > The fix I'm using is: > > (if (and (display-multi-font-p (frame-parameter frame 'display)) > (stringp default-font) ; <<<---!!! > (not (string-equal (frame-parameter frame 'font) default-font))) No, that's not the right fix, IMO. The code already takes care of not assuming default-font is a string when on TTY frames, but the condition doesn't work in this case for some reason. We need to understand why and fix that there. Thanks.