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: Mon, 12 Sep 2022 14:15:10 +0300 Message-ID: <83ills9741.fsf@gnu.org> References: <87v8pw1xyo.fsf@localhost> <83a678d5w6.fsf@gnu.org> <878rmr25tk.fsf@localhost> <83czc3bvbg.fsf@gnu.org> <87y1urybt6.fsf@localhost> <837d2bbr2s.fsf@gnu.org> <87edwjy77h.fsf@localhost> <831qsjboy0.fsf@gnu.org> <87v8puw945.fsf@localhost> <838rmq9rfr.fsf@gnu.org> <837d2a9qcu.fsf@gnu.org> <875yhtw3ed.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22632"; 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 Mon Sep 12 13:31:40 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 1oXhfA-0005ia-6V for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 13:31:40 +0200 Original-Received: from localhost ([::1]:34206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXhf9-0000RE-7b for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 07:31:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhQ4-0003aW-9F for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 07:16:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXhQ2-00084M-7A for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 07:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXhQ2-0006yI-3C for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 07:16: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: Mon, 12 Sep 2022 11:16: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.166298133324596 (code B ref 57693); Mon, 12 Sep 2022 11:16:02 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 12 Sep 2022 11:15:33 +0000 Original-Received: from localhost ([127.0.0.1]:44321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhPZ-0006NR-Ac for submit@debbugs.gnu.org; Mon, 12 Sep 2022 07:15:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhPW-00062m-TI for 57693@debbugs.gnu.org; Mon, 12 Sep 2022 07:15:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhPR-0007zo-0L; Mon, 12 Sep 2022 07:15:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Fgp8LrhhMLbRK/2U4ppzZ+16jXDK1/CCC+Oc494uOAY=; b=jmnab1lYGNx6 1jeeNvS/ehb41X5OrDexnwxP2N273Zrfho6z3Iz+xMkd1TgIgidqyfQzcUY8qW1ts6D56aEXQbDSI QTzO0eSeVCrBUzfyYlnpkYtaqIoIQydIPRAG76MzhgqPv8NpU1/gzEfm1G/tRSxFjarZ3RYfjA0/p SB625aRFk+wW+0nMKZtlzcL+iWTc8MD3LZ6NnalYdHsgxAgcTRW0NqaW4SvskTd9oNq4ZgGfhJZS7 WZULkQHe1aN9aKBVooX2hZ+y9/xcCE+fY6WQ8Uy6k5847JEbixkRpFuhPvNzNqir7blHlmE9tVchB ZDwvJ2Xf5XnTnOxWCCscng==; Original-Received: from [87.69.77.57] (port=2440 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 1oXhPQ-0004zo-FW; Mon, 12 Sep 2022 07:15:24 -0400 In-Reply-To: <875yhtw3ed.fsf@localhost> (message from Ihor Radchenko on Mon, 12 Sep 2022 13:46:50 +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:242237 Archived-At: > From: Ihor Radchenko > Cc: 57693@debbugs.gnu.org > Date: Mon, 12 Sep 2022 13:46:50 +0800 > > > Do you need this to work for TTY frames as well? If so, it could be a > > problem, since most terminal emulators don't provide a way of > > inquiring whether a certain character can be displayed. > > char-displayable-p currently just checks on most terminals that the > > terminal-coding-system can _encode_ the character, which isn't enough > > if the terminal encoding is UTF-8. > > The original code I was referring to unconditionally used a "safe" > fallback on terminals. If there is no technical possibility to determine > whether a character can be displayed, so be it. If the terminal's encoding is UTF-8, and it doesn't support the method we use to query about individual glyphs, char-displayable-p may return non-nil when the character cannot be displayed, i.e. will show as an empty box or something. Otherwise, char-displayable-p does provide the correct answer for TTY frames. > I am thinking about something like below (to insert string, not a char), LGTM.