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#57693: 29.0.50; Is there a more reliable version of `char-displayable-p'? Date: Fri, 09 Sep 2022 16:38:49 +0300 Message-ID: <83a678d5w6.fsf@gnu.org> References: <87v8pw1xyo.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9501"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57693@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 09 15:42:42 2022 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 1oWeHK-0002Ia-2P for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 15:42:42 +0200 Original-Received: from localhost ([::1]:51094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWeHI-0006wT-Jb for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 09:42:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWeEl-0003aB-0G for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWeEk-0002oM-NO for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWeEk-0000G2-JE for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:40:02 -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, 09 Sep 2022 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57693 X-GNU-PR-Package: emacs Original-Received: via spool by 57693-submit@debbugs.gnu.org id=B57693.1662730753929 (code B ref 57693); Fri, 09 Sep 2022 13:40:02 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 9 Sep 2022 13:39:13 +0000 Original-Received: from localhost ([127.0.0.1]:32903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWeDw-0000Ev-Jh for submit@debbugs.gnu.org; Fri, 09 Sep 2022 09:39:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWeDr-0000Ee-Rf for 57693@debbugs.gnu.org; Fri, 09 Sep 2022 09:39:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWeDl-0002in-Rx; Fri, 09 Sep 2022 09:39:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=BreaB/lNL1DhZiR+wo7kiM5yX5tHiNvI2ipXpSxGUJU=; b=K5HcBOHD54D1YuekVyhw 5FzpXo76H7ijAx9lYMB+zIhB+sJzxNLQ1aoikuQ09EU+CdroRBCi/GeiN/PdIF+trDFuARpbtEhBM I8rYLw38RJABmj2HAaFJsFhTkE3JlOtQDmhDiWrcKMwJ1fIV7zsEkhHDWy3K/3JADJ5mG0EhwuF4C pnljJst2uGyz7bZN2cvNbOGTgFGAz8C/InfM2w12lEvqwxs4puHWX6VK9vgYMePhVTtVNvhapsldo v7lwWeymVgwu3slTqdhP9GC5GNNOdBX8uRLbQRMUdoYo8TCy4jGi4vMY2JqhiQueAJpZanC2Cj7eK Cg9xDn0iPI2bcA==; Original-Received: from [87.69.77.57] (port=1451 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 1oWeDl-0000l0-BC; Fri, 09 Sep 2022 09:39:01 -0400 In-Reply-To: <87v8pw1xyo.fsf@localhost> (message from Ihor Radchenko on Fri, 09 Sep 2022 21:25:35 +0800) 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:241975 Archived-At: > From: Ihor Radchenko > Date: Fri, 09 Sep 2022 21:25:35 +0800 > > In Org, we have recently had a need to check if a Unicode character can > be displayed in buffer. > > We used the following: > (... > (if (and (display-graphic-p) > (char-displayable-p ?⭠) > (char-displayable-p ?─)) > "⭠ now ───────────────────────────────────────────────" > "now - - - - - - - - - - - - - - - - - - - - - - - - -") > ...) > > However, char-displayable-p returned false-positive for one user: > https://list.orgmode.org/orgmode/87mtddhprr.fsf@localhost/ > > False-positives are indeed not unexpected in char-displayable-p; just as > its docstring warns. However, I am now wondering if there is some more > accurate way to know if a character can be actually displayed on buffer > or not. I'd need to know more details. Why did this test fail for that user? Also, what exactly does the test above intend to test? Are you interested in whether this character can be displayed at all, regardless of which font is to be used, or do you want it to be displayed with the default face's font? To answer your question: the most accurate way is to actually try displaying the character and see if that works. Not sure if it helps you, though especially since that code is in a defcustom, AFAIU.