From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#57693: 29.0.50; Is there a more reliable version of `char-displayable-p'? Date: Sat, 18 Feb 2023 11:32:56 +0000 Message-ID: <871qmnky3b.fsf@localhost> 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> <831qmo146g.fsf@gnu.org> <83wn4fzcl5.fsf@gnu.org> <83lekvz605.fsf@gnu.org> 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="8239"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57693@debbugs.gnu.org, Stefan Kangas , yantar92@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 12:33:12 2023 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 1pTLSp-0001pV-Jx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 12:33:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTLSi-0000WF-4N; Sat, 18 Feb 2023 06:33:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTLSg-0000W3-WC for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 06:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTLSg-0007Nc-NW for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 06:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTLSg-0000ty-Ja for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 06:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 11:33: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.16767199483404 (code B ref 57693); Sat, 18 Feb 2023 11:33:02 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 18 Feb 2023 11:32:28 +0000 Original-Received: from localhost ([127.0.0.1]:42634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTLS8-0000sq-6u for submit@debbugs.gnu.org; Sat, 18 Feb 2023 06:32:28 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:42293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTLS6-0000s8-8E for 57693@debbugs.gnu.org; Sat, 18 Feb 2023 06:32:26 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6DF212403C6 for <57693@debbugs.gnu.org>; Sat, 18 Feb 2023 12:32:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1676719940; bh=4vup+r6BAOX/XFjtcJ2AT6clsX1bT/e4zayrqzB9Rmg=; h=From:To:Cc:Subject:Date:From; b=dLPkY3CTv2O8flMATbZ61umX073vE9cOrqR0evTRbU+Vjlm45IGJf2aPb4owiIuLP BL4ygFRYHMCVAIM4nPr54/RSJxCnGOz0P7Wa6lEQFZyPux3UnwQ8E48fl14RRdbwwb /iFxPA1HoJTn2mSQ2JRTTpE+qYIElpn2KeO6yQc8QxQ3GS6Aj852LnI0S7u+fSNQBu vCYCD9c8cUiuvy9OrGwaaeSU6EQlv0Q8qeMhkYtfrfTXGODszGsG5QOCbKExoSbZb5 ZW9Fbd/DKP9RBLcpbp8mY6wAtpKsDn30TV0DkAN88maB4k1rqmhQ3H348fl7oTRFQ3 MZmYvkEazM8Nw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PJmkC2Vrxz9rxF; Sat, 18 Feb 2023 12:32:19 +0100 (CET) In-Reply-To: <83lekvz605.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255955 Archived-At: Eli Zaretskii writes: >> (defun insert-char-safely (ch repl) >> "Insert character CH, if it can be displayed; otherwise insert REP= L. >> On TTY frames, always insert REPL." >> (if (not (display-graphic-p)) >> (insert repl) >> (insert ch) >> (unless (font-at (1- (point))) >> (delete-char -1) >> (insert repl)))) > > We could, but IME typical uses of fancy characters do not insert them > into a buffer, but use them in header-line, overlay strings, and > suchlikes. `font-at' accepts optional third argument STRING. For example, (font-at 0 nil "=F0=9F=A7=A0a") I am not sure how reliable this approach with string is though. As an alternative thought, may Emacs display engine accept a text property like 'display-alternative to display some fallback character/string if some parts of the displayed text cannot be displayed? --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at