From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas 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 01:00:38 -0800 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@gmail.com, 57693@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 10:01:31 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 1pTJ62-0004jP-T9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 10:01:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTJ5j-0007gr-Ul; Sat, 18 Feb 2023 04:01:11 -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 1pTJ5b-0007eZ-Pr for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 04:01:07 -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 1pTJ5a-0008Pg-Ia for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 04:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTJ5a-0004ty-4U for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 04:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 09:01: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.167671084718805 (code B ref 57693); Sat, 18 Feb 2023 09:01:02 +0000 Original-Received: (at 57693) by debbugs.gnu.org; 18 Feb 2023 09:00:47 +0000 Original-Received: from localhost ([127.0.0.1]:42442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTJ5K-0004tF-N5 for submit@debbugs.gnu.org; Sat, 18 Feb 2023 04:00:47 -0500 Original-Received: from mail-oi1-f171.google.com ([209.85.167.171]:46798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTJ5I-0004t0-Ht for 57693@debbugs.gnu.org; Sat, 18 Feb 2023 04:00:45 -0500 Original-Received: by mail-oi1-f171.google.com with SMTP id w7so335766oik.13 for <57693@debbugs.gnu.org>; Sat, 18 Feb 2023 01:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=JFVZYr2cPq9mOC+i/FoN294Rr8Vk38nHEgRlp1oiVV4=; b=FuAAoZ8nDQ00x0lFqfd72cKCizbX3KcNXQLjkV1d31AwHGVWSawLWZp66YyWHNKfFE F90DXxjS9ox2dby2OprDRGuUzCvskTrrKqADmC+D458WyadZjoIu9XCrHpFcAtZv9MX8 Ypd4aIvKUBeNAzUFO+8CNDMQw6qXKIuZ9L3jtTVOyJmRUVtqURYCIMCqWrikV1D3h9nz wYmQ0r/BsWdUb94I3wCOkcLWn6VfEvLMM46zjQI5O6Il4ivZCiTYiacxFtmnqq9oQWgk phnk3pVS5YVrnMMoAbmFrS9Gpi8/vMUt0rqPi/WQo9k+BartS7DqBprknkFJHoGudqeh CxRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JFVZYr2cPq9mOC+i/FoN294Rr8Vk38nHEgRlp1oiVV4=; b=owUtYvpvZeVkC87nVWEOY/6aOJoGU7jPlRNKKtfH4vhEcJFBHuvh3RQI4eKWSlFqwd VFqxcunCFFX6JXh3zyNwb0kmzB/ukcs2y9VZ+HklxpXivZvwW7uVeyn1evmpCJbP2HQk pBoJQXeN4pKiMH2272UNahZ6vmAirutkikMeZOOD9cT4S0rGtqdV0FCZuQl9OslrZQcV hVRjkuQhHLlh3dzI/YLDllLK2lKDFfEsQe8r9YjzsnV5GTD4p4m7MpVszcf+7f2byqZj 3fKob0Qgv96DGBYT0m0T8+c6RNkXsFVfdx2tD3NS8Ebjfv5iRUdyqeOG1ych61nTtnO3 dx9w== X-Gm-Message-State: AO0yUKWGPrEdtWeF535aSuJy4TbhXKxdIy9lP+46WWfTvWTH0GpE1jc6 7rb2RFac0YiNZNeXjUJclpVnwvh2KDf8irdT+84= X-Google-Smtp-Source: AK7set9nawzfLDxizwnvq8IJ9/GeHsfCQYO4HU2VfiziAnfDxJefhxRB9xImz0YeWccfy0kK4egEnim24IAiavF18Qo= X-Received: by 2002:a05:6808:11c5:b0:378:3f53:9e8 with SMTP id p5-20020a05680811c500b003783f5309e8mr777369oiv.291.1676710838762; Sat, 18 Feb 2023 01:00:38 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 18 Feb 2023 01:00:38 -0800 In-Reply-To: <83wn4fzcl5.fsf@gnu.org> X-Hashcash: 1:20:230218:57693@debbugs.gnu.org::fCNIjMlXkvxGnrr1:1YPW 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:255942 Archived-At: Eli Zaretskii writes: > That's for GUI displays only. And it's for strings, not characters. > To test a single character, you don't need a separate function, IMO, > you just need to use the test that is the core of that code. [...] > If you need to care for TTY frames, that problem has no known solution > that works for all terminal emulators. So using fancy characters in > general-purpose Emacs features is a problem that cannot be solved > programmatically, or at least we don't currently know how to do that. Thanks, those are useful clarifications. But could we not just fall back to the replacement on TTY frames instead? Something like: (defun insert-char-safely (ch repl) "Insert character CH, if it can be displayed; otherwise insert REPL. 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))))