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.devel Subject: Re: Display of undisplayable characters: \U01F3A8 instead of diamond Date: Sun, 04 Sep 2022 16:01:53 +0300 Message-ID: <83o7vvl2da.fsf@gnu.org> References: <2f302d1c3966849477b3@heytings.org> <83mtbiovzr.fsf@gnu.org> <83a67hq3l7.fsf@gnu.org> <83mtbhneht.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19763"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, gregory@heytings.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 04 15:03:23 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oUpHX-0004yf-EU for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Sep 2022 15:03:23 +0200 Original-Received: from localhost ([::1]:54382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUpHV-00077C-64 for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Sep 2022 09:03:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUpGZ-0006K4-I2 for emacs-devel@gnu.org; Sun, 04 Sep 2022 09:02:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUpGY-0001oi-9T; Sun, 04 Sep 2022 09:02:22 -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=SIpktVwr263SWBguF1FeBDD5l8YbPWBLNP8wW4feDxg=; b=A06NaJtanAup cQNG8VjCaGY++0J3/5CmY+dts7RVnKK9mZlKKWZPTmkkMo4u2Y3JtV1btlZk9KUEePe8Hd8ihkTYQ VA0cVbokMoWRmIDsQjVW1LceIrycAdr5NO47+Xmnt3id6OEWde9OXPGqVT51v6cq2V5PT3EL+daOy 3d5xLA0ZW9jiCOCv5T7ywGbgtUPbDh15G8y5OHFJGEe2O/G6NAU5atIRcVkJ/O6aaf3jBPsw4sO+V LZHl6xYWtrqkvecCFvlAE6UIWDuXExNxKE2qwW9icU6FPgzHF8PPdQtPvw4ARE9rP6PyCv3D4eWzC m98kNCF+ceC3fJ3jIQj0hg==; Original-Received: from [87.69.77.57] (port=3911 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 1oUpGT-0003xI-9a; Sun, 04 Sep 2022 09:02:17 -0400 In-Reply-To: (message from Alan Mackenzie on Sun, 4 Sep 2022 11:23:43 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294703 Archived-At: > Date: Sun, 4 Sep 2022 11:23:43 +0000 > Cc: rms@gnu.org, gregory@heytings.org, emacs-devel@gnu.org > From: Alan Mackenzie > > > > A few days ago you said it could use char-displayable-p > > > to determine this. If that works, it solves the problem of finding out > > > which characters to display as diamond. > > > It works, but looping over all the Unicode characters is very slow, so > > doing that at each startup would be unacceptable. If someone needs, I > > can show a simple code to be run by the user, once, on the Linux > > console, that would allow then to determine the codepoint ranges for > > which the U+FFFD (or any other) replacements are needed, so that users > > could run that code, and then put such customizations in their init > > files. We could even have a special command to do that, if people > > think it's important and helpful. > > > But all I hear till now is flat rejection of that solution, which is a > > very weak incentive (to say the least) to work on such a command. > > I will start working on this soon (if nobody else does in the meantime). No need, it's already done. See the new command standard-display-by-replacement-char. > I envisage having a minor mode specific to the Linux console, which when > enabled for the first time will do the loop over all Unicode characters > testing them for glyps, and create the display table. This loop takes a long time (25 sec in my unoptimized build, likely 5 sec in optimized ones), and needs to be run only once on a given terminal. So instead the command I added produces a buffer with Lisp code that you could eval and also add to your init file, to be run every startup. > This can then be > stored in .emacs in the customisation section. When the mode is > enabled, this display table will be used to output the \ufffd's. When > disabled, the glyphless characters will get printed as hex strings, as > currently. Possibly this will involve having two display tables which > will get swapped when the mode is en/disabled. Or something like that. I don't really see a reason to reset the display table to its default state, especially since it isn't clear what is that default. E.g., the startup code could add a few entries in the display-table (to show the Help buffers), as does info.el. You don't want to lose those setting, and there's no easy way of discerning them from the ones produced by the command we are discussing.