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: Sun, 11 Sep 2022 12:43:52 +0300 Message-ID: <838rmq9rfr.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13186"; 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 Sun Sep 11 11:45:14 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 1oXJWb-0003Dg-4s for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 11:45:13 +0200 Original-Received: from localhost ([::1]:34714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXJWZ-0007rd-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 05:45:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXJWQ-0007rV-Ip for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXJWQ-0003jP-94 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXJWP-0006jd-V3 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 05:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2022 09:45:01 +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.166288945925825 (code B ref 57693); Sun, 11 Sep 2022 09:45:01 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 11 Sep 2022 09:44:19 +0000 Original-Received: from localhost ([127.0.0.1]:40744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJVj-0006iT-9N for submit@debbugs.gnu.org; Sun, 11 Sep 2022 05:44:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJVh-0006iC-7s for 57693@debbugs.gnu.org; Sun, 11 Sep 2022 05:44:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXJVc-0003gN-1R; Sun, 11 Sep 2022 05:44:12 -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=biFUBkQDrcBZpgGYiDnLT9Vn9whHa0SMBxwzhoV02fM=; b=TdSMoAZb0EdF zEnDpe5aXz0bdANfGfWuhQ2HYbeiCbXNSSIgNayqSsAK29dO6v09O2gdVurcqaoLKPVr59xiqBZDk ApqE5QyKNRQ6M3iteur9R7KP1H3mu3195tjhv0yHBf8S6Ppi/adi2998XTvzjL7m9nLtFaxji7VsX KzHTOGX9RC2b5/NpwbJ1n8kC7kVgln/4huZs8wIhL6m9NacddHmOl878Iq64t9dc117pitzvs3r/w snuSEeIweGoIHjmVi7TLrsVTypOoCnbMMXBOAwnn6z0knEh64l72125dNn5jZHnRKhfDMhPPMSQcZ 5nfCsKaNRnRWPJ8KF8LlbA==; Original-Received: from [87.69.77.57] (port=4452 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 1oXJVa-0005K9-RL; Sun, 11 Sep 2022 05:44:11 -0400 In-Reply-To: <87v8puw945.fsf@localhost> (message from Ihor Radchenko on Sun, 11 Sep 2022 17:31:06 +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:242133 Archived-At: > From: Ihor Radchenko > Cc: 57693@debbugs.gnu.org > Date: Sun, 11 Sep 2022 17:31:06 +0800 > > Eli Zaretskii writes: > > >> Yup. And I am asking if there is such test exposed to Elisp. Display > >> code certainly knows when some character cannot be displayed and must be > >> replaced by its hex code. > > > > The display engine only knows it retroactively, when it tried and > > failed to display a character. > > The situation is similar to `string-pixel-width'. ??? You rejected such methods in an earlier message, because it required a temporary buffer, which you said will not reproduce the exact environment of the buffer where you want to show the character. Or what am I missing? > > insert the character > > call the new magic > > if the new magic says NO-CAN-DO > > replace the character with something else > > > > If the above is acceptable, I think it can be done, although it would > > not be very useful in other situations. But if you want to know the > > answer before you insert the character, I don't think we know how to > > satisfy your requirements with 100% accuracy. At least I cannot see > > how it could be done; maybe someone else will. > > The described approach should be acceptable. > What I have in mind is a function like > > (insert-displayable '("fancy version" "backup")) > > The function will try to insert "fancy version" first; check if all the > characters are displayable, and replace the inserted text with "backup" > if not. OK, I will see what I can do.