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: Fri, 02 Sep 2022 15:45:37 +0300 Message-ID: <83h71qosge.fsf@gnu.org> References: <87edx28cl1.fsf@disroot.org> <87bkry9ew4.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26486"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, emacs-devel@gnu.org To: Akib Azmain Turja Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 02 14:47:48 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 1oU65M-0006iN-9b for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 14:47:48 +0200 Original-Received: from localhost ([::1]:55290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU65L-0000b8-CT for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 08:47:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU62n-0006V1-9t for emacs-devel@gnu.org; Fri, 02 Sep 2022 08:45:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU62n-0007r5-17; Fri, 02 Sep 2022 08:45:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ZjL4mYFJYGBcncHR2ztbwskyhRBVYvKGPdPuAT7hXZc=; b=l8HkbQVSVgA57ducvtYJ lXqZlA1EYx/f5YwkiQa6Xf5NlUfL7QpgI55MjiavsFJRQkQnpdI9U6X8q2CuliMIHxC4MIpe1dfXc V9B8XLmH/C3PtbAvSORjBKX8YraZQdJej3PkAY54bNMEscarEY7syuELgUoFiB0Q3pifrYBzu7PZC /w0ZMfXp3s8C89L0Y7GGhETLQ+wsArpJ4tPsDbaSQEsfSF9aPUmb57fyM6Cqh+nK+GNorGtVlf8ZL Xvid1QB8dqKtJ2jMOcgvtInzQc/NL8cmqXa6up0s/i5a9VDzM9mZh5j5JeoRLTwIrw8ZxDj6iDHng PSqXXBcAIaTbDQ==; Original-Received: from [87.69.77.57] (port=1450 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 1oU62m-0002jW-3D; Fri, 02 Sep 2022 08:45:08 -0400 In-Reply-To: <87bkry9ew4.fsf@disroot.org> (message from Akib Azmain Turja on Fri, 02 Sep 2022 17:47:39 +0600) 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:294544 Archived-At: > From: Akib Azmain Turja > Cc: emacs-devel@gnu.org > Date: Fri, 02 Sep 2022 17:47:39 +0600 > > > > (set-char-table-extra-slot glyphless-char-display 0 'thin-space) > > > --8<---------------cut here---------------end--------------->8--- > > > > > This shows a single space character. > > > > Could a variant of that display a diamond instead of a space? > > I couldn't find one. I tried the following, but it didn't work: > > --8<---------------cut here---------------start------------->8--- > (set-char-table-extra-slot glyphless-char-display 0 "�") > --8<---------------cut here---------------end--------------->8--- > > It didn't show the diamond (or, in my case, a character similar to a > question mark in inverse video), which is the expected behavior > according to the manual, but it didn't even show the diamond in a box > (or square brackets), instead just a empty box appeared, which is > unexpected. It shouldn't work, indeed. See the doc string of glyphless-char-display. > > > One way of verifying this is to type > > > > > C-x 8 RET fffd RET > > > > > in an Emacs session which displays on the Linux console, and see if > > > that shows the diamond-like glyph or the \Unnnn thing. If it's the > > > latter, it means the console doesn't support that character, and we > > > cannot send its code from Emacs. > > How do Emacs know that determine whether a character is supported or > not? Using the encoding used for output? Emacs uses char-displayable-p for that purpose. > > but what is so bad about sending a glyph that the terminal can't > > display? What bad results does it cause? > > As long as the character can be encoded to the encoding the terminal > understand, AFAIK it's fine. That's insufficient. The Linux console uses UTF-8 encoding, but it doesn't support all the Unicode characters, although they all can be encoded by UTF-8. AFAIR, the Linux console supports at most 256 characters. > > Or how about fixing it by sending an official code for that diamond glyph? > > I think it's better. If that is what is wanted, we already have in Emacs the means to set the display to do it, and I already explained how to set that up. > But the format of glyphless-char-display should be > changed to allow something like the following too, which won't put the > text in a box: > > --8<---------------cut here---------------start------------->8--- > (set-char-table-extra-slot glyphless-char-display 0 (verbatim . "�")) > --8<---------------cut here---------------end--------------->8--- It won't, because the extra slot is the fallback, the last resort. So it cannot use any fancy non-ASCII characters. Which I also explained here.