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: Tue, 30 Aug 2022 14:41:49 +0300 Message-ID: <83pmgiufeq.fsf@gnu.org> References: <87edx28cl1.fsf@disroot.org> <83y1v7w6eu.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7418"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 30 13:49:07 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 1oSzju-0001ob-D9 for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 13:49:06 +0200 Original-Received: from localhost ([::1]:50158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSzjt-0000LF-16 for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Aug 2022 07:49:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSzca-0005Jy-Ez for emacs-devel@gnu.org; Tue, 30 Aug 2022 07:41:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSzcV-0000g4-UG for emacs-devel@gnu.org; Tue, 30 Aug 2022 07:41:31 -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=6yJELVkMxGKZkqcn9+xhkKfhcgRz8PX+OxDx3Bglvo0=; b=N7HaLOsQu0BW 5rQXsswPRCkHcmaDXnUr8d6YgZk3/pO9STqsk2QwxoNWiGHKN31H9Mk2Hojzr8uhf7W5cMV524Dlf Rd9GbQ1C52ef+dC4yHjm0ZLY5aS7tAfJePY3JsIPyGurkztWemCUiMqRubLSg7Qw5AD360tTuYZnA e2XQEXnb2DPc5vYwsXdG1yrw83o2PhFShtzWQPWiYe1Ad34DLk7HwDTilz3uvqXM+Ak1ZjpIIcjT6 pO+SCoIg8PWe18hl6SDAqbnIV+d/njDoixT2NNlVX7ozzTRe7RZKqvfc++XSyUZunzhS2DBWp+wgS iBP7ptT5nmtpQPwW2O4RmQ==; Original-Received: from [87.69.77.57] (port=2944 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 1oSzcU-0007Pg-T1; Tue, 30 Aug 2022 07:41:27 -0400 In-Reply-To: (message from Richard Stallman on Tue, 30 Aug 2022 00:12:02 -0400) 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:294331 Archived-At: > From: Richard Stallman > Cc: emacs-devel@gnu.org > Date: Tue, 30 Aug 2022 00:12:02 -0400 > > > No, because displaying a non-ASCII character on a text-mode terminal > > requires to encode it. > > Maybe the existing mechamisms will insist on encoring it, but I think > it won't be hard to bypass that step. The user could specify the > encoded sequence to send, by putting that sequence in a variable as a > string or vector. > > Then redisplay simply has to send the sequence of characters > from the vector, _as if_ they were the result of encoding something. This is possible technically, but it isn't safe, because figuring out the correct encoding of the terminal and producing a suitably-encoded byte sequence is tricky at best, for users to get right. And this is going to misfire if the user ever uses a terminal with a different encoding. More importantly, we are talking about a fallback feature, used for characters that fail to display in any other way we know. What you suggest is inappropriate for such fallback methods, which must be 110% safe. Using a display-table is therefore a much better way of adapting Emacs to the specific desires of the user in this case. For starters, the character codes emitted by the display-table are encoded as usual, when written to the terminal. > > This arranges for all the characters beyond 255 to be displayed as the > > diamond with a special face. (You can, of course, adjust the range of > > characters for which this is done according to your needs, or have > > several disjoint ranges instead of just one.) > > > Would that be good enough for your use patterns? > > With 255 specified, it would not be adequate. The Linux console handles > the Greek alphabet, the Russian alphabet, and I am not sure what else. Then maybe change #x100 to #x530 as the first approximation. > Using several disjoint ranges could do the job, I suppose, > if someone can tell me how to determine what those ranges should be. > > Could this be figured out automatically by calling char-displayable-p > on each character code? Such a code can be written, and can use char-displayable-p, indeed. > Up to what number would that loop have to run? Up to (and including) #x10FFFF.