From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Display of undisplayable characters: \U01F3A8 instead of diamond Date: Mon, 5 Sep 2022 18:59:32 +0000 Message-ID: References: <2f302d1c3966849477b3@heytings.org> <83mtbiovzr.fsf@gnu.org> <83a67hq3l7.fsf@gnu.org> <83mtbhneht.fsf@gnu.org> <83o7vvl2da.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8352"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, gregory@heytings.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 05 21:02:09 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 1oVHMH-0001x5-Ti for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Sep 2022 21:02:09 +0200 Original-Received: from localhost ([::1]:38630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVHMD-0003Sb-6P for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Sep 2022 15:02:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVHJy-0001wH-KQ for emacs-devel@gnu.org; Mon, 05 Sep 2022 14:59:46 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:58463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVHJw-0007iE-Ar for emacs-devel@gnu.org; Mon, 05 Sep 2022 14:59:46 -0400 Original-Received: (qmail 16247 invoked by uid 3782); 5 Sep 2022 20:59:33 +0200 Original-Received: from acm.muc.de (p4fe15a8b.dip0.t-ipconnect.de [79.225.90.139]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 Sep 2022 20:59:32 +0200 Original-Received: (qmail 16732 invoked by uid 1000); 5 Sep 2022 18:59:32 -0000 Content-Disposition: inline In-Reply-To: <83o7vvl2da.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.5; envelope-from=acm@muc.de; helo=mx3.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:294759 Archived-At: Hello, Eli. On Sun, Sep 04, 2022 at 16:01:53 +0300, Eli Zaretskii wrote: > > 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. Thanks, that works well. > > 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. The second time I tried it (having rebooted the machine between times) standard-display-by-replacement-char ran in around 0.077 seconds, which scarcely counts as slow. I don't know why it is fast on my machine, but slower on others'. Still, the code it produced is now firmly in my ..emacs. > > 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. OK. I suppose that people only rarely change the fonts they are using (more precisely, the character ranges of those fonts). -- Alan Mackenzie (Nuremberg, Germany).