From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#48408: BUGFIX: window-default-font-height: check for nil string Date: Fri, 14 May 2021 10:15:58 +0200 Message-ID: <25ac01b7-c6ef-3554-60d0-25ddead80495@gmx.at> References: <20210514011519.vsy5jbhyxd4v6kpt@E15-2016.optimum.net> <139ea227-861b-b3c3-c36a-9b7ac30a5acb@gmx.at> <83bl9dzsg5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8017"; mail-complaints-to="usenet@ciao.gmane.io" Cc: boruch_baum@gmx.com, 48408@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 10:18:26 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 1lhT1e-0001vC-Qd for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 10:18:26 +0200 Original-Received: from localhost ([::1]:49580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhT1d-0000hW-RU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 04:18:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhT0I-00061A-DU for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33401) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhT0I-0003R6-44 for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhT0H-0002JW-UB for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 04:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 08:17: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.16209801738824 (code B ref 48408); Fri, 14 May 2021 08:17:01 +0000 Original-Received: (at 48408) by debbugs.gnu.org; 14 May 2021 08:16:13 +0000 Original-Received: from localhost ([127.0.0.1]:44947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhSzV-0002IG-7K for submit@debbugs.gnu.org; Fri, 14 May 2021 04:16:13 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:51425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhSzO-0002HS-Sx for 48408@debbugs.gnu.org; Fri, 14 May 2021 04:16:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620980160; bh=lAeIJpuPrwhPhhXhJ1dMLFfqAAzr2M28hQVq8ilqKvE=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Jrkv3EgBDRtOuZJ8BdPZCEETjOmzCK9XHvdIuwbZtB0b1BA/2etyQ7ugoGveIl9Qe xjh9Bm+ITy6YlJ3aKQbehPMQzXfnnadvOYxvR3BLB1R8n3d3bDFs3SzsVrdomJ+6Ez AwKZrJrGHuTc1b4Tb9nbGee191YkSRoGvi0Ot97k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.218]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MI5UD-1lkRfz0FfD-00F9sm; Fri, 14 May 2021 10:16:00 +0200 In-Reply-To: <83bl9dzsg5.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:8c6TCb8x2lzgyicEk3Fu07JgNE1JPmFCGeXeESS+WFiaJxnYwNN Hhb95FBx/wdWVGDwO6abA40kC0gBH+uwTx0JlYShSiraGKEA4mni+GtsoI5S0jXqscC3Yn+ ilsp/v9ywGcDe8juyNbOyf7lu0w7pLrFoMtOdy0awfDwnM+c5b/X7Wkb1IAU62bAUtxAvFx 95kHRJ4c8USMo6Qc+knFw== X-UI-Out-Filterresults: notjunk:1;V03:K0:SfouZK4+FMo=:o9hcXovku181/A4AIkCjQ5 JLvEFeyrKX/hiKvmnyMzgsoqwvCkZYIgB7W911mSMeBNWO+CcjoNvCpM7N8iLpWUdDtLfQ2Px RrWzv5iUSf5mOrILmRfZBzERQGx2BlBuMn+9/7SLSd8tnVxGOTLr9uNDDmIV6eogVrfxshiCX U03kzWtufO8fwqDi9TG/4iiMJev4J4cyDeGe98VBhGm87q6o/NRGG5pZFpQRndnw95e5tq2iI t34vFOfOZp3HFf9UUUDsJ0oJTHUiiei9myLUpeq1KW8bGo1Ju0oB7jZXTJ4UFcTQCKCA4wBsI 4qBQG7eIAWzC3A1Wf5q8WrqGPMWlYxBKaSuMYKSn9gmdUZuM3aexawBeN7BvGjv70FAkeIYlx nx85noKZeHVk/wdxjVyB1kYew4MdfqMIikmZiP/fAtcchAE6C6aVRMqFDDi9+fWhPquWz4ebo bYKzbTr4sBHBQPLCpFbL9MBSfeA5Fz8rMbKd7KYMtiwmFGVwSSEYGBWPSaZ+AVGMjqoZZJRsC MXVXgyKkMyHcC/YF5i1ySOQuzWBX/kBqJ/IDHaYVWjRatK5hXNV5e1/jy19a2HL0/DctBSI1x 3OFGxPSLvDHnT7+yk7sIPFBKE3TnL2pEpG4Sv8TupoRVdoD8l4hzESCchWmG9fb0PZTl5MDpt TaogmzO52vSMwpsLjZr2i+/X6dRPQAgDX1E9QZ358WsUWkcnKrW/yjd2Wu+N2NuvkUiKYpPD6 rwIMvo5sks33z6I+xo5mqw250YURBsj+2rdmvSevHrBMT59coHrl/dJ1DBitMYR/mpPUXkyI 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:206498 Archived-At: >> Sorry. This function is missing from my current window.el here ... > > Really? It is still there on today's master. So I wonder what kind > of revolution do you have waiting in the wings... Nothing special. Just a function that takes its buffer's face remapping into account. But it lacks an alias and is apparently just as broken as the old one, see below. martin (defun window-face-font-height (&optional window buffer-or-name face) "Return font height in pixels of FACE for BUFFER-OR-NAME in WINDOW. WINDOW must be a live window and defaults to the selected one. BUFFER-OR-NAME may be a buffer or the name of an existing buffer and defaults to WINDOW's buffer. FACE must specify a valid face and defaults to the default face. The return value accounts for any remapping of FACE's font (see `face-remapping-alist') in BUFFER-OR-NAME. If no such remapping has been specified, return the height of the font of FACE for WINDOW's frame. If BUFFER-OR-NAME does not specify WINDOW's buffer, calculate the return value with WINDOW's buffer temporarily set to the buffer specified by BUFFER-OR-NAME." (let* ((window (window-normalize-window window t)) (frame (window-frame window))) (if (display-multi-font-p frame) (let* ((buffer (if buffer-or-name (window-normalize-buffer buffer-or-name) (window-buffer window))) (face (or face 'default)) (font (if (eq window (selected-window)) (window--buffer-face-font buffer face) (with-selected-window window (window--buffer-face-font buffer face)))) (frame-font (frame-parameter frame 'font))) ;; Avoid calling `font-info' if the font whose info we want is ;; the same as the corresponding frame's default font since ;; `font-info' is expensive for some fonts, see bug #14838. (if (and font (not (string-equal font frame-font))) (aref (font-info font frame) 3) (frame-char-height frame))) (frame-char-height frame))))