From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim 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 15:46:40 +0200 Message-ID: <87sfl07j9b.fsf@gmail.com> References: <87v8pw1xyo.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13978"; 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:58:37 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 1oWeWj-0003VX-My for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 15:58:37 +0200 Original-Received: from localhost ([::1]:36420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWeWi-0004mu-Qu for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 09:58:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWeLX-0004Fz-0l for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWeLW-0004hm-Iy for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWeLW-0000Ro-EM for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 09:47:02 -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, 09 Sep 2022 13:47: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.16627312101700 (code B ref 57693); Fri, 09 Sep 2022 13:47:02 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 9 Sep 2022 13:46:50 +0000 Original-Received: from localhost ([127.0.0.1]:32912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWeLJ-0000RL-RB for submit@debbugs.gnu.org; Fri, 09 Sep 2022 09:46:50 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:39496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWeLI-0000R9-7W for 57693@debbugs.gnu.org; Fri, 09 Sep 2022 09:46:48 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id n12so2828946wru.6 for <57693@debbugs.gnu.org>; Fri, 09 Sep 2022 06:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=zhmYfvjkbc4cm2GxajUOhiW65c+mB2HScLckc9vU50A=; b=Pkt/mz1dbuNzzWM/HCxmQtmDHgC5a8SSgF1c6fDM/rbhHS0T4wYItWaxQEJphaNdC0 9pcuFbhMnEkxCKT3TbPnZ30sTIj9mkMTeEGwFIzSvBT60/bcnLR4sIAfv2dPDbbXqk4n jD1mQYFpTU2B/heQO2w8U5zeVreOb2yZf3KBknmm7mBWaHtl07PB0b0nGsD9EMeGTWUE y2Nv6VOmpOOuqw7uKeiVCxEzPsyRVjVMirHqLtypIEJ8lrrE7o2liQUfQoaRbBH3RNH1 OyGIAKJeVMlREUp/YJvq4ktmymy32JdEdut2OJEh/x94ow8xVCBk1oN5Uc+4HEKoQWKr V8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=zhmYfvjkbc4cm2GxajUOhiW65c+mB2HScLckc9vU50A=; b=ho4e099gY/bD1Cb5YMo3IHz+mtLwvd09GWToS6P2uz/3A0a5QwYQqqIBkMez/B/WLP BntLAFUKv0yl3UcHANd9NlKO/l9mWSTSmWPAqEbMA0X+b83n22WNHt9Fj2OAoucmCcEx 8555vgbJa/0qaC0wFdGORcxYpx3cRciBaNGDUuEZjByZJQfHxZ7Yeofbv7AeeVlD73Ds 6+jLMM3/Vb7cg+TxHiLQVkQTB1hPEhng2kFvEWIdoQrJV7S/SGp/o/CZ6PfnoHCl5GNW QTKHJuTfIebVFaOqVSGoqe5wQSYCG39MxXowwMzUVUL3a/9k1Mw5COLGBx4T5hv0gdnc 4gnQ== X-Gm-Message-State: ACgBeo2yWAiJn2frtfMoDPyy7Fw8SDlZC4UL/SAuw62okeU8h3PTCj7R 1Gvkznl5VCDlpwyuXWiKCaD/lnHWXRI= X-Google-Smtp-Source: AA6agR4ZAIIN9GaIIIrUvvQbhv8xA6r/KzxmSVqCImU/G6nE++B0yxurQe4O3fFNy7gxD6R6/5T5zw== X-Received: by 2002:adf:f90d:0:b0:20c:de32:4d35 with SMTP id b13-20020adff90d000000b0020cde324d35mr8011286wrr.583.1662731201840; Fri, 09 Sep 2022 06:46:41 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:a290:d8f3:806c:3938]) by smtp.gmail.com with ESMTPSA id l16-20020a5d5610000000b0021e43b4edf0sm568641wrv.20.2022.09.09.06.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 06:46:41 -0700 (PDT) In-Reply-To: <87v8pw1xyo.fsf@localhost> (Ihor Radchenko's message of "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:241976 Archived-At: >>>>> On Fri, 09 Sep 2022 21:25:35 +0800, Ihor Radchenko said: Ihor> Hello, Ihor> In Org, we have recently had a need to check if a Unicode charact= er can Ihor> be displayed in buffer. Ihor> We used the following: Ihor> (... Ihor> (if (and (display-graphic-p) Ihor> (char-displayable-p ?=E2=AD=A0) Ihor> (char-displayable-p ?=E2=94=80)) Ihor> "=E2=AD=A0 now =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80" Ihor> "now - - - - - - - - - - - - - - - - - - - - - - - - -") Ihor> ...) Ihor> However, char-displayable-p returned false-positive for one user: Ihor> https://list.orgmode.org/orgmode/87mtddhprr.fsf@localhost/=20 Ihor> False-positives are indeed not unexpected in char-displayable-p; = just as Ihor> its docstring warns. However, I am now wondering if there is some= more Ihor> accurate way to know if a character can be actually displayed on = buffer Ihor> or not. I=CA=BCd look at the guts of `describe-char-display' in "lisp/descr-text.el" for inspiration (or even use it as is). It takes a `pos' argument so you may have to wrap it in `with-temp-buffer' + `insert'. Robert --=20