GNU bug report logs - #26396
25.1; char-displayable-p on a latin1 tty

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kevin Ryde <user42_kevin@HIDDEN>; dated Sat, 8 Apr 2017 02:24:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 18 Apr 2017 18:19:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 18 14:19:13 2017
Received: from localhost ([127.0.0.1]:55086 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0XiZ-0007F4-7O
	for submit <at> debbugs.gnu.org; Tue, 18 Apr 2017 14:19:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40706)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d0XiY-0007Es-Cv
 for 26396 <at> debbugs.gnu.org; Tue, 18 Apr 2017 14:19:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1d0XiP-00022S-4F
 for 26396 <at> debbugs.gnu.org; Tue, 18 Apr 2017 14:19:05 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60588)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1d0XiP-00022N-16; Tue, 18 Apr 2017 14:19:01 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3500
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1d0XiO-0007h4-9a; Tue, 18 Apr 2017 14:19:00 -0400
Date: Tue, 18 Apr 2017 21:19:35 +0300
Message-Id: <83k26hd1e0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <0e10a8aa-0388-2a85-28a9-07f055624345@HIDDEN> (message from
 Paul Eggert on Tue, 18 Apr 2017 10:49:37 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN> <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
 <83mvbfe9sg.fsf@HIDDEN> <b9c48971-f7d6-df8e-9cfe-771f6c3963a6@HIDDEN>
 <83tw5mdgwq.fsf@HIDDEN> <0e10a8aa-0388-2a85-28a9-07f055624345@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Tue, 18 Apr 2017 10:49:37 -0700
> 
> On 04/17/2017 11:32 AM, Eli Zaretskii wrote:
> > Can you show an example of a character displayed in different forms
> > depending on buffer contents?  I'd like to look what the code does and why.
> 
> In master on the Linux console in non-UTF-8 mode and with a unibyte 
> en_US locale, if I run 'emacs -Q' and type 'C-x 8 RET 100 RET C-x 8 RET 
> 200 RET' the screen looks like this:
> 
> \u0100\u0200
> 
> If I then type 'C-x 8 RET 300 RET', the '\u0200' magically changes to 
> '?' and another '?' is appended, so that the screen then looks like this:
> 
> \u0100??

Yes, I see that, too.

> Presumably this is some sort of combining-character thing.

Yes.  Try "C-u C-x =" on the first '?', and you will see.  Or type
"M-x auto-composition-mode RET" to disable composition and get your
original characters back.

> However, if the intent is to present a combined character, shouldn't
> the character be displayed as a single '?', to better mimic the
> single glyph you'd see on an X display?

It probably should (if we want at all to allow compositions on text
terminals, which is questionable on non UTF-8 TTYs).

> By the way, the '?'s look like ordinary question marks; they are not 
> highlighted, as the \u0100 is. Shouldn't they be highlighted somehow? 

AFAIU, the '?' should not appear at all, as glyphless-char-display
specifies hex codes for those codepoints.  This is one of the
manifestations of the fact that glyphless-char-display doesn't work
correctly on TTY frames.  This code from term.c:

  else
    {
      Lisp_Object charset_list = FRAME_TERMINAL (it->f)->charset_list;

      if (char_charset (it->char_to_display, charset_list, NULL))
	{
	  it->pixel_width = CHARACTER_WIDTH (it->char_to_display);
	  it->nglyphs = it->pixel_width;
	  if (it->glyph_row)
	    append_glyph (it);
	}
      else
	{
	  Lisp_Object acronym = lookup_glyphless_char_display (-1, it);

	  eassert (it->what == IT_GLYPHLESS);
	  produce_glyphless_glyph (it, acronym);
	}
    }

is weird, because the test in char_charset, which controls how such
characters will be displayed, makes little sense to me.  The idea was
to see if the character belongs to one of the charsets supported by
the terminal, but in practice this doesn't work.

> And while I have your ear, why is U+0700 SYRIAC END OF PARAGRAPH 
> displayed as an ordinary '?' while U+0500 CYRILLIC CAPITAL LETTER KOMI 
> DE is displayed as a highlighted '\u0500'?

AFAIU, that's a direct consequence of the above weird test.
Characters which fail the char_charset test are displayed via
produce_glyphless_glyph, which on a TTY produces \uNNNN, whereas
characters which pass the test are just appended verbatim to the
buffer that is then encoded by terminal-coding-system, and that
produces the question marks for unsupported characters, bypassing
glyphless-char-display.  That's the bug I'd like to fix.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 18 Apr 2017 17:49:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 18 13:49:52 2017
Received: from localhost ([127.0.0.1]:55051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0XGC-0004kD-8c
	for submit <at> debbugs.gnu.org; Tue, 18 Apr 2017 13:49:52 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47444)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1d0XG9-0004jw-Fe
 for 26396 <at> debbugs.gnu.org; Tue, 18 Apr 2017 13:49:50 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7D03A16008C;
 Tue, 18 Apr 2017 10:49:43 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id eaZW-3pwpCjH; Tue, 18 Apr 2017 10:49:42 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id C007216008E;
 Tue, 18 Apr 2017 10:49:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Oo8M_mpCI4Ng; Tue, 18 Apr 2017 10:49:42 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6E0C516007C;
 Tue, 18 Apr 2017 10:49:42 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN> <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
 <83mvbfe9sg.fsf@HIDDEN> <b9c48971-f7d6-df8e-9cfe-771f6c3963a6@HIDDEN>
 <83tw5mdgwq.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <0e10a8aa-0388-2a85-28a9-07f055624345@HIDDEN>
Date: Tue, 18 Apr 2017 10:49:37 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <83tw5mdgwq.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/17/2017 11:32 AM, Eli Zaretskii wrote:
> Can you show an example of a character displayed in different forms
> depending on buffer contents?  I'd like to look what the code does and why.

In master on the Linux console in non-UTF-8 mode and with a unibyte 
en_US locale, if I run 'emacs -Q' and type 'C-x 8 RET 100 RET C-x 8 RET 
200 RET' the screen looks like this:

\u0100\u0200

If I then type 'C-x 8 RET 300 RET', the '\u0200' magically changes to 
'?' and another '?' is appended, so that the screen then looks like this:

\u0100??

Presumably this is some sort of combining-character thing. However, if 
the intent is to present a combined character, shouldn't the character 
be displayed as a single '?', to better mimic the single glyph you'd see 
on an X display?

By the way, the '?'s look like ordinary question marks; they are not 
highlighted, as the \u0100 is. Shouldn't they be highlighted somehow? 
And while I have your ear, why is U+0700 SYRIAC END OF PARAGRAPH 
displayed as an ordinary '?' while U+0500 CYRILLIC CAPITAL LETTER KOMI 
DE is displayed as a highlighted '\u0500'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 18:31:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 14:31:44 2017
Received: from localhost ([127.0.0.1]:52865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0BRA-0005hl-Hx
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 14:31:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37636)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d0BR9-0005hZ-L7
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 14:31:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1d0BR0-0007If-A3
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 14:31:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49215)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1d0BR0-0007IZ-5g; Mon, 17 Apr 2017 14:31:34 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1867
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1d0BQz-0008QH-DY; Mon, 17 Apr 2017 14:31:33 -0400
Date: Mon, 17 Apr 2017 21:32:05 +0300
Message-Id: <83tw5mdgwq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <b9c48971-f7d6-df8e-9cfe-771f6c3963a6@HIDDEN> (message from
 Paul Eggert on Mon, 17 Apr 2017 11:08:09 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN> <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
 <83mvbfe9sg.fsf@HIDDEN> <b9c48971-f7d6-df8e-9cfe-771f6c3963a6@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Mon, 17 Apr 2017 11:08:09 -0700
> 
> On 04/17/2017 01:08 AM, Eli Zaretskii wrote:
> 
> > My reading of the code is that at least some of these unsupported
> > characters will NOT be displayed as \uNNNNN, but rather as some
> > fallback glyph produced by the console itself, which is not what we
> > want, I think.
> Yes, that's what happens. It's not ideal, and perhaps it could be 
> improved. (I hope by someone else....)

Lat's hope.

> There are similar display problems even in unibyte mode on the Linux 
> console. Sometimes a character above U+00FF  is displayed as '\uNNNN', 
> sometimes as '?', sometimes the same character is displayed in different 
> forms depending on what else is in the buffer, and I don't know why. 
> (And likewise, I don't want to spend time worrying about this, as the 
> 1990s are long gone....)

Yes, the TTY code that handles such characters has some very weird
logic.

Can you show an example of a character displayed in different forms
depending on buffer contents?  I'd like to look what the code does and
why.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 18:08:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 14:08:20 2017
Received: from localhost ([127.0.0.1]:52853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0B4W-00059l-9X
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 14:08:20 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37926)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1d0B4T-00059V-NY
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 14:08:18 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 00E2B160092;
 Mon, 17 Apr 2017 11:08:11 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id WJDFUXQxaTSF; Mon, 17 Apr 2017 11:08:10 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4444E16007A;
 Mon, 17 Apr 2017 11:08:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id VODFS5c9zPnW; Mon, 17 Apr 2017 11:08:10 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E1A58160092;
 Mon, 17 Apr 2017 11:08:09 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN> <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
 <83mvbfe9sg.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <b9c48971-f7d6-df8e-9cfe-771f6c3963a6@HIDDEN>
Date: Mon, 17 Apr 2017 11:08:09 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <83mvbfe9sg.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/17/2017 01:08 AM, Eli Zaretskii wrote:

> My reading of the code is that at least some of these unsupported
> characters will NOT be displayed as \uNNNNN, but rather as some
> fallback glyph produced by the console itself, which is not what we
> want, I think.
Yes, that's what happens. It's not ideal, and perhaps it could be 
improved. (I hope by someone else....)

There are similar display problems even in unibyte mode on the Linux 
console. Sometimes a character above U+00FF  is displayed as '\uNNNN', 
sometimes as '?', sometimes the same character is displayed in different 
forms depending on what else is in the buffer, and I don't know why. 
(And likewise, I don't want to spend time worrying about this, as the 
1990s are long gone....)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 17:22:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 13:22:25 2017
Received: from localhost ([127.0.0.1]:52798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0AM4-000450-W6
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 13:22:25 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57024)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1d0AM2-00044n-Iw
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 13:22:23 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id CC9B3160101;
 Mon, 17 Apr 2017 10:22:16 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id talFcgBSvqeq; Mon, 17 Apr 2017 10:22:16 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 020C3160103;
 Mon, 17 Apr 2017 10:22:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Mqr_uGOIdmmt; Mon, 17 Apr 2017 10:22:15 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9FD0B1600E3;
 Mon, 17 Apr 2017 10:22:15 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <081710d5-c33c-c8af-fc4b-561594056f3e@HIDDEN> <83pogbebez.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <02f4616d-2f2d-a075-fe74-4273f2265c83@HIDDEN>
Date: Mon, 17 Apr 2017 10:22:15 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <83pogbebez.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------5EAD740B76D2E2158C59D73D"
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

This is a multi-part message in MIME format.
--------------5EAD740B76D2E2158C59D73D
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 04/17/2017 12:33 AM, Eli Zaretskii wrote:
> Shouldn't we be looking at ->encoder instead?

Sure, that's easy enough. I installed the attached.


--------------5EAD740B76D2E2158C59D73D
Content-Type: text/x-patch;
 name="0001-Tighten-recently-added-UTF-8-check.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-Tighten-recently-added-UTF-8-check.patch"

From 3c9227324f43a2e331dbbfcd2f41c8d49e3f3d6b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@HIDDEN>
Date: Mon, 17 Apr 2017 10:19:39 -0700
Subject: [PATCH] Tighten recently-added UTF-8 check

* src/coding.c (encode_coding_utf_8): Now extern.
* src/terminal.c (terminal_glyph_code) [HAVE_STRUCT_UNIPAIR_UNICODE]:
Check for UTF-8, not just for multibyte.
---
 src/coding.c   | 2 +-
 src/coding.h   | 1 +
 src/terminal.c | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/coding.c b/src/coding.c
index e341a71..367a975 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1449,7 +1449,7 @@ decode_coding_utf_8 (struct coding_system *coding)
 }
 
 
-static bool
+bool
 encode_coding_utf_8 (struct coding_system *coding)
 {
   bool multibytep = coding->dst_multibyte;
diff --git a/src/coding.h b/src/coding.h
index 77f90ec..8ed851d 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -664,6 +664,7 @@ struct coding_system
 
 /* Extern declarations.  */
 extern Lisp_Object code_conversion_save (bool, bool);
+extern bool encode_coding_utf_8 (struct coding_system *);
 extern void setup_coding_system (Lisp_Object, struct coding_system *);
 extern Lisp_Object coding_charset_list (struct coding_system *);
 extern Lisp_Object coding_system_charset_list (Lisp_Object);
diff --git a/src/terminal.c b/src/terminal.c
index 3d25b36..367f2ac 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -576,8 +576,9 @@ terminal_glyph_code (struct terminal *t, int ch)
 {
 #if HAVE_STRUCT_UNIPAIR_UNICODE
   /* Heuristically assume that a terminal supporting glyph codes is in
-     UTF-8 mode if and only if its coding system is multibyte (Bug#26396).  */
-  if (t->type == output_termcap && t->terminal_coding->src_multibyte)
+     UTF-8 mode if and only if its coding system is UTF-8 (Bug#26396).  */
+  if (t->type == output_termcap
+      && t->terminal_coding->encoder == encode_coding_utf_8)
     {
       /* As a hack, recompute the table when CH is the maximum
 	 character.  */
-- 
2.9.3


--------------5EAD740B76D2E2158C59D73D--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 08:07:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 04:07:56 2017
Received: from localhost ([127.0.0.1]:51404 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d01hU-000466-4G
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 04:07:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d01hS-00045r-63
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 04:07:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1d01hJ-0007Vu-LP
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 04:07:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41680)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1d01hJ-0007Ve-ID; Mon, 17 Apr 2017 04:07:45 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1026
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1d01hI-0005ih-C6; Mon, 17 Apr 2017 04:07:44 -0400
Date: Mon, 17 Apr 2017 11:08:15 +0300
Message-Id: <83mvbfe9sg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN> (message from
 Paul Eggert on Sun, 16 Apr 2017 23:41:33 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN> <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Sun, 16 Apr 2017 23:41:33 -0700
> 
> Eli Zaretskii wrote:
> > I can offer help in reviewing the patches and perhaps also writing
> > some of that, but I cannot test the code, as I don't have a convenient
> > access to a Linux console where I could run Emacs I build.
> 
> Rather than descend into this swamp I am hoping that the patch I installed is 
> enough to solve Kevin's problem.

I thought we were discussing a broader issue: how to make Emacs work
better on a Linux console, not just how to fix char-displayable-p.

At the very least, I think we should teach Emacs to call
terminal_glyph_code when it decides whether a given character should
be displayed as glyphless or not.  E.g., what do you get on a Linux
console when trying to output a character beyond the BMP, like u+17001
or u+1F800? do you get the expected \uNNNNN representation?  And what
does Emacs display for characters from the BMP that are not supported
by the console's font?

My reading of the code is that at least some of these unsupported
characters will NOT be displayed as \uNNNNN, but rather as some
fallback glyph produced by the console itself, which is not what we
want, I think.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 07:32:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 03:32:48 2017
Received: from localhost ([127.0.0.1]:51383 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d019U-0003I0-MW
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 03:32:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43708)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d019T-0003Hn-G5
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 03:32:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1d019J-0007wX-1E
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 03:32:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41398)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1d019I-0007wT-Uy; Mon, 17 Apr 2017 03:32:36 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4939
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1d019I-0003bt-3X; Mon, 17 Apr 2017 03:32:36 -0400
Date: Mon, 17 Apr 2017 10:33:08 +0300
Message-Id: <83pogbebez.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <081710d5-c33c-c8af-fc4b-561594056f3e@HIDDEN> (message from
 Paul Eggert on Sun, 16 Apr 2017 22:56:08 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
 <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
 <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
 <83o9vwgafr.fsf@HIDDEN> <87k26jd9ho.fsf@HIDDEN>
 <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <081710d5-c33c-c8af-fc4b-561594056f3e@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Paul Eggert <eggert@HIDDEN>
> Date: Sun, 16 Apr 2017 22:56:08 -0700
> 
> +  if (t->type == output_termcap && t->terminal_coding->src_multibyte)

Hmm... I'm not sure this is the right condition.  In particular,
set-terminal-coding-system-internal always sets the src_multibyte
flag, for any terminal encoding.  Shouldn't we be looking at ->encoder
instead?  See setup_coding_system for how this is set up for UTF-8.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 07:31:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 03:31:30 2017
Received: from localhost ([127.0.0.1]:51378 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d018E-0003Fy-BS
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 03:31:30 -0400
Received: from nm22-vm7.bullet.mail.gq1.yahoo.com ([98.136.217.70]:47329)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1d018D-0003Fm-0s
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 03:31:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1492414283; bh=5pB27sX9i/8EOJzFLIEXLlmpnnBUI/FiFr4uGE+I4zk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject;
 b=MCHwoeyNMnrvY7xXgBk6RqJ+srs5D7HhYQgHLFRJXtRFhqgI3NPkBNDUooKs6reT14tu7kpBAOCr0DJOspEs/9gTihwccKLQ0O6WbdZQxisSuMS3XHRYy1tWRU5404nuuJKDqdq+GLoAlAZ0uHeDvKZO5N9T61qdGaSMUSdDw0x4rTD/qqRNUQ4dSjMCjaOxEJ8kcKxvwPAFOtorInl7yeCrFosPsQTtR/VLAqWdb1ovN3S+7CnJDWCFwDvN1tzvx/DSWg8y7RGF4stmJBHrE3e3zyCnCvuaAFaVWMXjXMC1aSehX8kmG1v80NwDUf+v8KyDKqm/vKacVOrTcDEPBA==
Received: from [98.137.12.55] by nm22.bullet.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 07:31:23 -0000
Received: from [208.71.42.211] by tm15.bullet.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 07:31:23 -0000
Received: from [127.0.0.1] by smtp222.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 07:31:23 -0000
X-Yahoo-Newman-Id: 90686.66602.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: SZX.W8IVM1mGJ5LDttIVEcdtRL68QygKXXU5FT7AXb3p3a8
 IadaGF55FOMAXX8V9mH9yU0_VLQLQjGfuIHxNqmzZfU7L82.izFlqlWEyuMO
 6Q5AUfCw1ghRW6MTCzmkYWJz11i8rWKrfZQI.1wx2oPRn7jqsNV7fSkYSfg1
 ZNhoPBe8bAxqEGqe0ntPokdeHEBTyNbHf.lTQrBXqu9.AkvEky1dkcLiTXaD
 rjuB1gaOwcdntNeB9UMhkjoPndL8NPrqZYNCrmfCDMkgOZ3QGRm9d0c1dts6
 zoknCU0iEbWYQeq7iouQq29fX9YuIgGLtbUeXR6ge3OMha85uUr9HtMdlf3o
 xy2XUBnhuEReWJ48VWhM7UhbaiLzXMwqsXTP0Ob780xZeqMF0gfCzMj1tHNO
 4BH7X6pk8AajpzAllu7nKNQyqnV01d.VFJXUMx.kBPMD0iHQqw1bSnhdiOPV
 30dMj67KptQRlgvxDBXEQxkPJDTIoMxM8Pg8AMOfGVApMCFyV_LhDSuRnlWT
 hBPkF4Tgovivl5GgRu7AIhqB0wj5ac6YBuRJ0YTmdwBasmtQvBLsMVxGdeA- -
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: 26396 <at> debbugs.gnu.org
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
 <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
 <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
 <83o9vwgafr.fsf@HIDDEN> <87k26jd9ho.fsf@HIDDEN>
 <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN>
 <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
Date: Mon, 17 Apr 2017 17:27:20 +1000
In-Reply-To: <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN> (Paul Eggert's
 message of "Sun, 16 Apr 2017 23:41:33 -0700")
Message-ID: <878tmzijdz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 26396
Cc: Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.8 (--)

Paul Eggert <eggert@HIDDEN> writes:
>
> Rather than descend into this swamp ...

I don't want to go in a swamp :).  As much like plain tty is fine.

> I am hoping that the patch I
> installed is enough to solve Kevin's problem.

So GIO_UNIMAP internal-font-char case applies when a multibyte
terminal-coding-system ... that being presumed to be utf8 ...
and any unibyte terminal-coding-system goes down the encodeable
case.  Sounds good.

> ...
> assume that the terminal's coding system (as per Emacs) is consistent
> with the Linux console UTF-8 output mode (as per the Linux kernel),
> i.e., it's the user's responsibility to get all the settings right.

Yep, beaut.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 06:41:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 02:41:42 2017
Received: from localhost ([127.0.0.1]:51339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d00M2-0000GP-Db
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:41:42 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50506)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1d00M0-0000GC-Ur
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:41:41 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 679411600B5;
 Sun, 16 Apr 2017 23:41:34 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id PN4qZxwRwSU3; Sun, 16 Apr 2017 23:41:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id ACEAD1600BA;
 Sun, 16 Apr 2017 23:41:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id e-MQeH1rwR26; Sun, 16 Apr 2017 23:41:33 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8D4621600B5;
 Sun, 16 Apr 2017 23:41:33 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
 <83vaq3eell.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <0fe79f3f-9023-a5d9-b610-199ce6d7bf62@HIDDEN>
Date: Sun, 16 Apr 2017 23:41:33 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <83vaq3eell.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Eli Zaretskii wrote:
> I can offer help in reviewing the patches and perhaps also writing
> some of that, but I cannot test the code, as I don't have a convenient
> access to a Linux console where I could run Emacs I build.

Rather than descend into this swamp I am hoping that the patch I installed is 
enough to solve Kevin's problem. The basic idea is to assume that the terminal's 
coding system (as per Emacs) is consistent with the Linux console UTF-8 output 
mode (as per the Linux kernel), i.e., it's the user's responsibility to get all 
the settings right.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 06:24:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 02:24:01 2017
Received: from localhost ([127.0.0.1]:51319 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d004v-0008Hg-2z
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:24:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d004t-0008HU-OQ
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:23:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1d004l-0003lX-Gu
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:23:54 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40891)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1d004l-0003lQ-DX; Mon, 17 Apr 2017 02:23:51 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4821
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1d004k-0008B4-CU; Mon, 17 Apr 2017 02:23:50 -0400
Date: Mon, 17 Apr 2017 09:24:22 +0300
Message-Id: <83vaq3eell.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN> (message from
 Paul Eggert on Sun, 16 Apr 2017 20:26:01 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
 <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
 <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
 <83o9vwgafr.fsf@HIDDEN> <87k26jd9ho.fsf@HIDDEN>
 <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Paul Eggert <eggert@HIDDEN>
> Date: Sun, 16 Apr 2017 20:26:01 -0700
> 
> Kevin Ryde wrote:
> 
> > Debian has an easy line in /etc/default/console-setup.  The default is
> > now utf8 but there's lots more.  I have it latin1.
> 
> In that case I stand corrected: some people are stull using non-UTF-8 Linux 
> consoles. I don't know of any convenient programmatic way for Emacs to determine 
> whether the console is in UTF-8 output mode, though. (I can think of complicated 
> ways, involving outputting bytes to the screen and seeing what happens to the 
> cursor position; but this would be destructive to the screen contents.) I agree 
> Emacs shouldn't be changing the mode.

I agree.

Regarding testing it, the simplest way is to provide a user variable
which will tell Emacs about the console's mode, and ask users who
don't want the UTF-8 mode to set that variable to that effect.  Or
maybe my idea about using terminal-coding-system as an indication of
that could be workable, in which case it's a better alternative.
WDYT?

I can offer help in reviewing the patches and perhaps also writing
some of that, but I cannot test the code, as I don't have a convenient
access to a Linux console where I could run Emacs I build.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 06:19:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 02:19:02 2017
Received: from localhost ([127.0.0.1]:51314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d0006-0008AV-Ah
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:19:02 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59282)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1d0004-0008A2-OW
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:19:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1czzzw-0001Mg-1w
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 02:18:55 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40858)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1czzzv-0001MP-Tf; Mon, 17 Apr 2017 02:18:51 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4816
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1czzzu-0007xW-Vs; Mon, 17 Apr 2017 02:18:51 -0400
Date: Mon, 17 Apr 2017 09:19:22 +0300
Message-Id: <83wpajeetx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <17547644-c802-588c-c620-ac1ed0e3e67c@HIDDEN> (message from
 Paul Eggert on Sun, 16 Apr 2017 13:25:42 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <17547644-c802-588c-c620-ac1ed0e3e67c@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Sun, 16 Apr 2017 13:25:42 -0700
> 
> Eli Zaretskii wrote:
> 
> > That depends on how easy it is to check whether the console is in
> > UTF-8 mode.  Isn't that just another ioctl?
> 
> Not as far as I know, for output mode. I looked for one and could not find it.

Then perhaps we should intuit that from terminal-coding-system.

> >>> and that the user
> >>>     didn't override by a call to set-terminal-coding-system
> >>
> >> It might be simpler to not worry about this, under the argument that the Linux
> >> console is not a terminal in the usual sense.
> >
> > Once again, checking this is easy
> 
> I don't see offhand how to distinguish a user's call to 
> set-terminal-coding-system from one that Emacs does internally as part of its 
> existing heuristics.

There are only a handful of such calls.  What I had in mind was to
review our heuristics and avoid calling set-terminal-coding-system
there.  Failing that, we could put a property on, say, the terminal
object to indicate whether the setting is by user or by Emacs.

> Plus, even if the user invokes set-terminal-coding-system, 
> when the Linux console is in UTF-8 mode (as it invariably is these days) Emacs 
> will do the wrong thing if blindly follows the user's setting.

Sorry, I don't follow: what wrong thing will Emacs do in this case?
Did you mean the user invoked set-terminal-coding-system with UTF-8 as
argument or with some other encoding?

> > We've heard over the
> > years from several users who make a point of using non UTF-8 locales,
> 
> On Linux consoles? Who does that nowadays?

I think Alan does, and we now know that Kevin does as well.  Plus,
term/linux.el does this:

  (defun terminal-init-linux ()
    "Terminal initialization function for linux."
    (unless (terminal-coding-system)
      (set-terminal-coding-system 'iso-latin-1))

which I guess needs to be revised?

> CJK locales have never worked on the Linux console, so the only concerns here 
> are ISO 8859 Latin and Cyrillic consoles, that sort of thing.

What about ISO 8859-8 or ISO 8859-6?

> Generally 
> speaking, the rare people who care about Linux console encoding and want to use 
> non-ASCII characters on their Linux consoles, switched from 8-bit locales to 
> UTF-8 long ago: the code was added to Linux in 2007 and UTF-8 mode was made the 
> default, and users took the usual one to three years to switch. So this is all 
> ancient history now by GNU/Linux standards. It's not clear that we can even test 
> the old 8-bit mode any more; it didn't work on my Fedora 25 Linux console when I 
> tried. It's a waste of time to write code that isn't needed and can't be tested.

I see your point, but I think we've been burnt by such decisions in
the past, so I'd prefer to leave a fire escape for users who for some
reasons don't follow the above patterns.  And the code that supports
the 8-bit mode is already written, we just need to leave it in place
when some conditions aren't satisfied.

> > Glyphless characters are those that cannot be displayed.  On GUI
> > frames, we determine that by looking up the character in the available
> > fonts; if none is available, we display the character as determined by
> > glyphless-char-display.  On TTY frames, we do it differently, and the
> > way we do it doesn't currently consult the char-table created by
> > calculate_glyph_code_table.  I'm saying that we should
> 
> Yes, exactly. A frame connected to a Linux console should act like a GUI frame 
> not an ordinary tty frame, because we know which characters the console can 
> display and we don't have to resort to guesswork and user settings like we do 
> with an ordinary tty frame.

Well, actually the TTY frames also pretends to know which characters
the console can display, it just does a less than perfect job in the
case of a Linux console.  So I think most of the code to handle this
can be left intact, we just need to reference the char-table created
by calculate_glyph_code_table when appropriate.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 05:56:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 17 01:56:17 2017
Received: from localhost ([127.0.0.1]:51297 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czze5-0007e4-Cf
	for submit <at> debbugs.gnu.org; Mon, 17 Apr 2017 01:56:17 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47216)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1czze4-0007do-5W
 for 26396 <at> debbugs.gnu.org; Mon, 17 Apr 2017 01:56:16 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 06B9D160095;
 Sun, 16 Apr 2017 22:56:10 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id VqNKqbdBD_V5; Sun, 16 Apr 2017 22:56:09 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3CFA71600B5;
 Sun, 16 Apr 2017 22:56:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 4qB2OEUBfXXQ; Sun, 16 Apr 2017 22:56:09 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1AE1D160095;
 Sun, 16 Apr 2017 22:56:09 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Kevin Ryde <user42_kevin@HIDDEN>, 26396 <at> debbugs.gnu.org
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN> <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <081710d5-c33c-c8af-fc4b-561594056f3e@HIDDEN>
Date: Sun, 16 Apr 2017 22:56:08 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
Content-Type: multipart/mixed; boundary="------------C106BA4A5E542D39BCA0BD84"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

This is a multi-part message in MIME format.
--------------C106BA4A5E542D39BCA0BD84
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Paul Eggert wrote:
> In that case I stand corrected: some people are stull using non-UTF-8 Linux
> consoles.

I installed the attached patch into master to try to work around the problem 
that prompted the original bug report. This patch assumes that the terminal 
coding system is compatible with the Linux console output mode (either UTF-8, or 
unibyte), which I hope is good enough, as anybody whose locale is incompatible 
with the output mode will have lots of other problems anyway. Please give the 
patch a try.

--------------C106BA4A5E542D39BCA0BD84
Content-Type: text/x-diff;
 name="0001-Work-around-bug-with-unibyte-Linux-consoles.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0001-Work-around-bug-with-unibyte-Linux-consoles.patch"

From 746e0bb2fc148cdb96bdde75e810dd5ce446e3a4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@HIDDEN>
Date: Sun, 16 Apr 2017 22:50:02 -0700
Subject: [PATCH] Work around bug with unibyte Linux consoles

* src/terminal.c (terminal_glyph_code): Skip the UTF-8 stuff if
the terminal's coding system is unibyte (Bug#26396).
---
 src/terminal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/terminal.c b/src/terminal.c
index 0b1cbe7..3d25b36 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -575,7 +575,9 @@ Lisp_Object
 terminal_glyph_code (struct terminal *t, int ch)
 {
 #if HAVE_STRUCT_UNIPAIR_UNICODE
-  if (t->type == output_termcap)
+  /* Heuristically assume that a terminal supporting glyph codes is in
+     UTF-8 mode if and only if its coding system is multibyte (Bug#26396).  */
+  if (t->type == output_termcap && t->terminal_coding->src_multibyte)
     {
       /* As a hack, recompute the table when CH is the maximum
 	 character.  */
-- 
2.7.4


--------------C106BA4A5E542D39BCA0BD84--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 03:26:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 16 23:26:14 2017
Received: from localhost ([127.0.0.1]:51237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czxIs-0000Uw-FA
	for submit <at> debbugs.gnu.org; Sun, 16 Apr 2017 23:26:14 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1czxIq-0000Ui-An
 for 26396 <at> debbugs.gnu.org; Sun, 16 Apr 2017 23:26:12 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6350A160090;
 Sun, 16 Apr 2017 20:26:06 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Q0s5KvS2e6qM; Sun, 16 Apr 2017 20:26:05 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8A31C160095;
 Sun, 16 Apr 2017 20:26:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id o6qoPMQ1deFi; Sun, 16 Apr 2017 20:26:05 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6E947160090;
 Sun, 16 Apr 2017 20:26:05 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Kevin Ryde <user42_kevin@HIDDEN>, 26396 <at> debbugs.gnu.org
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
 <87k26jd9ho.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <2685c665-652c-644a-9550-e0e283d9f315@HIDDEN>
Date: Sun, 16 Apr 2017 20:26:01 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <87k26jd9ho.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Kevin Ryde wrote:

> Debian has an easy line in /etc/default/console-setup.  The default is
> now utf8 but there's lots more.  I have it latin1.

In that case I stand corrected: some people are stull using non-UTF-8 Linux 
consoles. I don't know of any convenient programmatic way for Emacs to determine 
whether the console is in UTF-8 output mode, though. (I can think of complicated 
ways, involving outputting bytes to the screen and seeing what happens to the 
cursor position; but this would be destructive to the screen contents.) I agree 
Emacs shouldn't be changing the mode.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 03:04:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 16 23:04:13 2017
Received: from localhost ([127.0.0.1]:51232 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czwxZ-0008SS-JR
	for submit <at> debbugs.gnu.org; Sun, 16 Apr 2017 23:04:13 -0400
Received: from nm28-vm10.bullet.mail.gq1.yahoo.com ([98.136.216.169]:46470)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1czwxW-0008SE-Or
 for 26396 <at> debbugs.gnu.org; Sun, 16 Apr 2017 23:04:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1492398245; bh=RE3mU3IO676uGyeHnBkMuiXoyU9sAssaBmuDGLx64HU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject;
 b=neXaA4EZFP0glNlm7mFwjaa56NTSrVua7DMLSqpkJ00eFc4kIKo9zdP8kVwZz04Ip1iiToucdcdHk8fICSuOr4kDKYn295L1HDTTM7Y42VA48jFhQf5b9oiu+J3D4m5L59M3XwXCr3WLZX0wkaIiIVAyO2hEvr31fb9NlrU7xu919dY8Ea6rtLHqXEDLzhs1iZhU182TyO8x5CG1YHI+YFNhRDQgl4tTnIsasraHbUy7UobVWhV0pcPzkgeG54cXJJlYe60CCVogUVaNm7M9oSd8QY0SdoZTvxq5TDm9Q3T8HqZide27AMBkEl75WrbgvyezmUzY8BnbV3Jkk++sxA==
Received: from [216.39.60.183] by nm28.bullet.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 03:04:05 -0000
Received: from [208.71.42.207] by tm19.bullet.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 03:04:05 -0000
Received: from [127.0.0.1] by smtp218.mail.gq1.yahoo.com with NNFMP;
 17 Apr 2017 03:04:05 -0000
X-Yahoo-Newman-Id: 135760.87926.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: vs8pwpMVM1ml3b1V0H8LVr6QHjJ6XF0yLCJFXv1bxD893U1
 v9ab8G8xiE1B3gHu7RJKnMS.j_u53MsbBFFaWyMmuj0ajwBStK7_JXauMswT
 Z.1TovqmI.hub4cf_ukGoZ3sdPrN0ztCV2B0R_X0_qVhXwS2Hzxe4jDKbVtl
 Th6eCvZZNUQqcvpTc4MxMCZ_.5i6aI89xrG_Fk53EIjK8_HPdT8U_ZXvnkS6
 32j7LqRsmFaclSb361gxk9HVSaqRpGwa1LRhF2TR22py_UQR4r1RWJcSCc6f
 GCZ3MhuG5nVeRZnz75A_cz3BjBuUlq6_p1IrWq9vlUyxiBSjvngmDOXzwTnn
 WO1XssUyF_NHRxK68grLs6MBYQsHh09rsUDRvXCbOJih0khQS.o0Wnl0q.F2
 yehHojsCBl_9h2L8EH7NEynCwTgaPwwh5lIJ4DxF62OvAj_9tHprglpszBoj
 rlGyJJaspSbfEfDxVKMaq755I0.qJTu9B6bSuirtYwmzSmjnH0VhFTuv06xO
 d_MvvIJPbNaNzcd9xSJCfIDt5Og24NMiNWXCKNn6pfIdGM7vjyEMnqrWzFVi O
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: 26396 <at> debbugs.gnu.org
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
 <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
 <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
 <83o9vwgafr.fsf@HIDDEN>
Date: Mon, 17 Apr 2017 13:00:03 +1000
In-Reply-To: <83o9vwgafr.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 16 Apr
 2017 08:59:04 +0300")
Message-ID: <87k26jd9ho.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: 26396
Cc: Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.5 (---)

Eli Zaretskii <eliz@HIDDEN> writes:
>
> We've heard over the
> years from several users who make a point of using non UTF-8 locales,
> and I expect them to have reasons for that.  I wouldn't want us to
> break their configurations.

Debian has an easy line in /etc/default/console-setup.  The default is
now utf8 but there's lots more.  I have it latin1.

Paul Eggert <eggert@HIDDEN> writes:
>
> ... The problem is that other parts of the code
> obey terminal-coding-system instead of what the Linux console can
> actually display.

I think I'd like char-displayable-p to obey terminal-coding-system too
like those parts, since that is the bytes which are sent out.

I imagine making minimal enquiries into the console settings would be
both less thinking needed in emacs and more give the user what setup
they chose.  Doing stuff to change the mode doesn't sound good.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 16 Apr 2017 20:25:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 16 16:25:51 2017
Received: from localhost ([127.0.0.1]:50998 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czqk3-0007kj-F0
	for submit <at> debbugs.gnu.org; Sun, 16 Apr 2017 16:25:51 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33868)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1czqk1-0007kV-G0
 for 26396 <at> debbugs.gnu.org; Sun, 16 Apr 2017 16:25:49 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id DB2E5160083;
 Sun, 16 Apr 2017 13:25:43 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id s5JpOtUPUMwE; Sun, 16 Apr 2017 13:25:43 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 16CF4160090;
 Sun, 16 Apr 2017 13:25:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id JoBdGz4qfi2D; Sun, 16 Apr 2017 13:25:43 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id EDEEE160083;
 Sun, 16 Apr 2017 13:25:42 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> <83o9vwgafr.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <17547644-c802-588c-c620-ac1ed0e3e67c@HIDDEN>
Date: Sun, 16 Apr 2017 13:25:42 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <83o9vwgafr.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Eli Zaretskii wrote:

> That depends on how easy it is to check whether the console is in
> UTF-8 mode.  Isn't that just another ioctl?

Not as far as I know, for output mode. I looked for one and could not fin=
d it.

>>> and that the user
>>>     didn't override by a call to set-terminal-coding-system
>>
>> It might be simpler to not worry about this, under the argument that t=
he Linux
>> console is not a terminal in the usual sense.
>
> Once again, checking this is easy

I don't see offhand how to distinguish a user's call to=20
set-terminal-coding-system from one that Emacs does internally as part of=
 its=20
existing heuristics. Plus, even if the user invokes set-terminal-coding-s=
ystem,=20
when the Linux console is in UTF-8 mode (as it invariably is these days) =
Emacs=20
will do the wrong thing if blindly follows the user's setting.

> We've heard over the
> years from several users who make a point of using non UTF-8 locales,

On Linux consoles? Who does that nowadays?

CJK locales have never worked on the Linux console, so the only concerns =
here=20
are ISO 8859 Latin and Cyrillic consoles, that sort of thing. Generally=20
speaking, the rare people who care about Linux console encoding and want =
to use=20
non-ASCII characters on their Linux consoles, switched from 8-bit locales=
 to=20
UTF-8 long ago: the code was added to Linux in 2007 and UTF-8 mode was ma=
de the=20
default, and users took the usual one to three years to switch. So this i=
s all=20
ancient history now by GNU/Linux standards. It's not clear that we can ev=
en test=20
the old 8-bit mode any more; it didn't work on my Fedora 25 Linux console=
 when I=20
tried. It's a waste of time to write code that isn't needed and can't be =
tested.

> Glyphless characters are those that cannot be displayed.  On GUI
> frames, we determine that by looking up the character in the available
> fonts; if none is available, we display the character as determined by
> glyphless-char-display.  On TTY frames, we do it differently, and the
> way we do it doesn't currently consult the char-table created by
> calculate_glyph_code_table.  I'm saying that we should

Yes, exactly. A frame connected to a Linux console should act like a GUI =
frame=20
not an ordinary tty frame, because we know which characters the console c=
an=20
display and we don't have to resort to guesswork and user settings like w=
e do=20
with an ordinary tty frame.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 16 Apr 2017 05:58:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 16 01:58:47 2017
Received: from localhost ([127.0.0.1]:49667 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czdCx-0005pb-AD
	for submit <at> debbugs.gnu.org; Sun, 16 Apr 2017 01:58:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35464)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1czdCv-0005pO-C9
 for 26396 <at> debbugs.gnu.org; Sun, 16 Apr 2017 01:58:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1czdCn-0005Cw-17
 for 26396 <at> debbugs.gnu.org; Sun, 16 Apr 2017 01:58:40 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54735)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1czdCm-0005Cq-U0; Sun, 16 Apr 2017 01:58:36 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3390
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1czdCm-0006c8-4S; Sun, 16 Apr 2017 01:58:36 -0400
Date: Sun, 16 Apr 2017 08:59:04 +0300
Message-Id: <83o9vwgafr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN> (message from
 Paul Eggert on Sat, 15 Apr 2017 14:12:40 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
 <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Sat, 15 Apr 2017 14:12:40 -0700
> 
> Eli Zaretskii wrote:
> > So, the plan seems to be this:
> >
> >   . make sure the terminal is in Unicode mode,
> 
> I don't think we need to worry about whether the console is in UTF-8 mode. UTF-8 
> mode has been the default for years, and unless the user goes to a good deal of 
> trouble (and I suspect this part of the Linux kernel hasn't been tested 
> recently) we can assume UTF-8 mode.
> 
> There is a subtlety here. The console can be in UTF-8 mode for input ('stty 
> iutf8' vs 'stty -iutf8'), but that's not what we're concerned about: we're 
> concerned whether it's in UTF-8 mode for output. I don't see how the user can 
> affect the latter other than by outputting ESC % @ and ESC % G. And I just now 
> tried outputting these sequences to my Linux console but they didn't seem to 
> affect anything. Without the ability to test this stuff and with no real need to 
> worry about it that I can see, I suggest that we just assume UTF-8 mode.

That depends on how easy it is to check whether the console is in
UTF-8 mode.  Isn't that just another ioctl?  If doing so is not too
hard, I'd prefer to include such a test.  Users IME are likely to find
and (ab)use any dark corner they have at their disposal, and I'd
prefer to have a sound solution rather than leave subtle bugs that
wait to be reported.

> >and that the user
> >     didn't override by a call to set-terminal-coding-system
> 
> It might be simpler to not worry about this, under the argument that the Linux 
> console is not a terminal in the usual sense.

Once again, checking this is easy, and I'd prefer that Emacs didn't
get in users' ways of doing what they want.  We've heard over the
years from several users who make a point of using non UTF-8 locales,
and I expect them to have reasons for that.  I wouldn't want us to
break their configurations.

> > I notice that we don't use terminal_glyph_code when determining
> > whether a given character should be treated as glyphless, so I guess
> > that means we could produce something other than what
> > glyphless-char-display says for a given character; this should be
> > fixed.
> 
> Sorry, I am not quite following this, but yes the various parts of Emacs should 
> be consistent in this area.

Glyphless characters are those that cannot be displayed.  On GUI
frames, we determine that by looking up the character in the available
fonts; if none is available, we display the character as determined by
glyphless-char-display.  On TTY frames, we do it differently, and the
way we do it doesn't currently consult the char-table created by
calculate_glyph_code_table.  I'm saying that we should, because
otherwise we let certain characters be displayed with the console's
replacement glyph instead of the way mandated by glyphless-char-display.

> > Also, the above means set-locale-environment should not call
> > set-terminal-coding-system if the display is a Linux console that
> > supports this feature.
> 
> This matters only if we worry about the terminal coding system in Linux 
> consoles, which it isn't clear we should do.

I think we should.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 15 Apr 2017 21:12:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 15 17:12:50 2017
Received: from localhost ([127.0.0.1]:49440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czUzy-0008UP-J3
	for submit <at> debbugs.gnu.org; Sat, 15 Apr 2017 17:12:50 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1czUzw-0008UC-FV
 for 26396 <at> debbugs.gnu.org; Sat, 15 Apr 2017 17:12:49 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 53345160072;
 Sat, 15 Apr 2017 14:12:42 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 5hBj5SXag7Aj; Sat, 15 Apr 2017 14:12:41 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7E8331600BD;
 Sat, 15 Apr 2017 14:12:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 3VPpir_krl8O; Sat, 15 Apr 2017 14:12:41 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3BFEB160072;
 Sat, 15 Apr 2017 14:12:41 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> <834lxqgipc.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@HIDDEN>
Date: Sat, 15 Apr 2017 14:12:40 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <834lxqgipc.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Eli Zaretskii wrote:
> So, the plan seems to be this:
>
>   . make sure the terminal is in Unicode mode,

I don't think we need to worry about whether the console is in UTF-8 mode=
. UTF-8=20
mode has been the default for years, and unless the user goes to a good d=
eal of=20
trouble (and I suspect this part of the Linux kernel hasn't been tested=20
recently) we can assume UTF-8 mode.

There is a subtlety here. The console can be in UTF-8 mode for input ('st=
ty=20
iutf8' vs 'stty -iutf8'), but that's not what we're concerned about: we'r=
e=20
concerned whether it's in UTF-8 mode for output. I don't see how the user=
 can=20
affect the latter other than by outputting ESC % @ and ESC % G. And I jus=
t now=20
tried outputting these sequences to my Linux console but they didn't seem=
 to=20
affect anything. Without the ability to test this stuff and with no real =
need to=20
worry about it that I can see, I suggest that we just assume UTF-8 mode.

>and that the user
>     didn't override by a call to set-terminal-coding-system

It might be simpler to not worry about this, under the argument that the =
Linux=20
console is not a terminal in the usual sense. Certainly set-locale-enviro=
nment=20
should not override the fact that Emacs is connected to a Linux console. =
(You=20
mention this below.)

>   . if a character has a glyph in the Unicode font, send a UTF-8
>     encoding for the character to the screen, disregarding the
>     terminal encoding as mandated by the locale
>   . if the character doesn't have a glyph in the console font, treat
>     it as glyphless

This sounds right.

>   . if the conditions in the first item above are not met, fall back
>     to the current code which encodes using the terminal encoding

As I mentioned above, perhaps we should not worry about those conditions =
and=20
therefore not worry about falling back to the current code.

> I notice that we don't use terminal_glyph_code when determining
> whether a given character should be treated as glyphless, so I guess
> that means we could produce something other than what
> glyphless-char-display says for a given character; this should be
> fixed.

Sorry, I am not quite following this, but yes the various parts of Emacs =
should=20
be consistent in this area.

> Also, the above means set-locale-environment should not call
> set-terminal-coding-system if the display is a Linux console that
> supports this feature.

This matters only if we worry about the terminal coding system in Linux=20
consoles, which it isn't clear we should do.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 15 Apr 2017 08:47:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 15 04:47:59 2017
Received: from localhost ([127.0.0.1]:47835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1czJN9-0006n9-Lb
	for submit <at> debbugs.gnu.org; Sat, 15 Apr 2017 04:47:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46286)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1czJN8-0006mx-3N
 for 26396 <at> debbugs.gnu.org; Sat, 15 Apr 2017 04:47:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1czJMz-0005Rl-O0
 for 26396 <at> debbugs.gnu.org; Sat, 15 Apr 2017 04:47:52 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42796)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1czJMz-0005Rh-KP; Sat, 15 Apr 2017 04:47:49 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4237
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1czJMy-0007m7-RH; Sat, 15 Apr 2017 04:47:49 -0400
Date: Sat, 15 Apr 2017 11:48:15 +0300
Message-Id: <834lxqgipc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN> (message from
 Paul Eggert on Fri, 14 Apr 2017 11:56:32 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
 <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> > Suppose we only wanted to use this feature for UTF-8 locales.
> > Assuming that the OS takes care of putting the console in UTF-8 mode,
> > we don't need any changes in Emacs, since Emacs already sends UTF-8
> > sequences to the screen driver.  As the Linux console only supports
> > the BMP, we could then simply amend the code of char-displayable-p to
> > check whether a character is within the BMP, when the terminal is the
> > Linux console.  Do you agree with this conclusion?
> 
> No, because a character is displayable only if it's in that set of 
> at-most-512 characters.
> 
> > OTOH, now I'm not sure I understand the need for terminal_glyph_code.
> > What does it do that a simple check for a Linux console and UTF-8
> > terminal encoding, plus a character being inside a BMP, don't?
> 
> terminal_glyph_code gets the current set of at-most-512 displayable 
> characters from from the kernel.

Right, I missed the 512-character part.  Quite a limitation, btw.

So, the plan seems to be this:

  . make sure the terminal is in Unicode mode, and that the user
    didn't override by a call to set-terminal-coding-system
  . if a character has a glyph in the Unicode font, send a UTF-8
    encoding for the character to the screen, disregarding the
    terminal encoding as mandated by the locale
  . if the character doesn't have a glyph in the console font, treat
    it as glyphless
  . if the conditions in the first item above are not met, fall back
    to the current code which encodes using the terminal encoding

I notice that we don't use terminal_glyph_code when determining
whether a given character should be treated as glyphless, so I guess
that means we could produce something other than what
glyphless-char-display says for a given character; this should be
fixed.

Also, the above means set-locale-environment should not call
set-terminal-coding-system if the display is a Linux console that
supports this feature.

Is that right?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 14 Apr 2017 19:48:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 14 15:48:55 2017
Received: from localhost ([127.0.0.1]:47502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cz7DC-0000Er-VT
	for submit <at> debbugs.gnu.org; Fri, 14 Apr 2017 15:48:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56023)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1cz7DB-0000Ee-EY
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 15:48:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rms@HIDDEN>) id 1cz7D5-0000lo-4R
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 15:48:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34618)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>)
 id 1cz7D0-0000gm-2E; Fri, 14 Apr 2017 15:48:42 -0400
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1cz7Cz-0000wy-7b; Fri, 14 Apr 2017 15:48:41 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <ae92fb7c-d501-0c08-c325-407be5a48022@HIDDEN> (message from
 Paul Eggert on Thu, 13 Apr 2017 15:18:29 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <E1cymtr-0003Ac-Kj@HIDDEN>
 <ae92fb7c-d501-0c08-c325-407be5a48022@HIDDEN>
Message-Id: <E1cz7Cz-0000wy-7b@HIDDEN>
Date: Fri, 14 Apr 2017 15:48:41 -0400
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, eliz@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Does Emacs always know for certain?
  > If Emacs is attached directly to a console, yes. There's already some 
  > code that does this, by using Linux-specific syscalls.

  > > What if it is talking to that console via ssh?

If we can provide the data thru terminfo
then the functionality will work even thru ssh.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 14 Apr 2017 18:59:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 14 14:59:40 2017
Received: from localhost ([127.0.0.1]:47487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cz6RX-0005ng-Pm
	for submit <at> debbugs.gnu.org; Fri, 14 Apr 2017 14:59:39 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cz6RX-0005nU-1W
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 14:59:39 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 97354160102;
 Fri, 14 Apr 2017 11:59:33 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id jaWGE9URExpY; Fri, 14 Apr 2017 11:59:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id EA31D160101;
 Fri, 14 Apr 2017 11:59:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id AQ0JVPp6QC01; Fri, 14 Apr 2017 11:59:32 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id AE3F61600F2;
 Fri, 14 Apr 2017 11:59:32 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Kevin Ryde <user42_kevin@HIDDEN>, 26396 <at> debbugs.gnu.org
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <87zifj4rq7.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <e16d0d45-e5b0-d266-3534-f8b4c7b443b3@HIDDEN>
Date: Fri, 14 Apr 2017 11:59:32 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <87zifj4rq7.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/13/2017 08:01 PM, Kevin Ryde wrote:
> Would char-displayable-p always check encodable and then
> ponder what further the kernel ioctls can say about viewable glphs.

Yes, that's what char-displayable-p does now: it checks that the 
character is one of the at-most-512 characters that the Linux console 
can currently display. For Linux consoles this is independent of 
terminal-coding-system. The problem is that other parts of the code obey 
terminal-coding-system instead of what the Linux console can actually 
display.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 14 Apr 2017 18:56:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 14 14:56:44 2017
Received: from localhost ([127.0.0.1]:47483 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cz6Oh-0005jb-Mm
	for submit <at> debbugs.gnu.org; Fri, 14 Apr 2017 14:56:44 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41072)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cz6Of-0005jN-Jp
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 14:56:42 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id A064B1600FE;
 Fri, 14 Apr 2017 11:56:34 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id n2jnpAdZj8Km; Fri, 14 Apr 2017 11:56:33 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 65106160100;
 Fri, 14 Apr 2017 11:56:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id grd2JpkAXrYw; Fri, 14 Apr 2017 11:56:33 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1FA701600FE;
 Fri, 14 Apr 2017 11:56:33 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> <83inm7go6o.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <24bd0681-08d5-137f-29df-715eefddf2ae@HIDDEN>
Date: Fri, 14 Apr 2017 11:56:32 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <83inm7go6o.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/14/2017 05:37 AM, Eli Zaretskii wrote:
>> This should not be a problem, as the Linux console has only 
>> single-width characters. 
> Are you sure?  AFAIU, the Linux console supports the BMP, and some of
> the characters in the BMP are double-width (a.k.a. "full-width"), for
> example U+1100, U+231A, U+2B1B, and others.  What does the Linux
> console do when these characters are sent to the screen driver?

I haven't experimented with it, so I'm not 100% sure. However, as I 
understand the implementation, the console driver can support at most 
512 simultaneously-displayable characters, as this is a property of the 
classic IBM VGA design that is the greatest common denominator of 
current or recent (post-1990) PC graphics hardware. The user can specify 
what each character looks like down to the pixel level, but cannot alter 
character sizes on a character-by-character basis. In theory one could 
display double-wide characters by splitting them into halves and 
displaying each half separately, but I don't know of anyone who does 
that (it would not be practical due to that 512 limit).

>
>>> And what does "display as-is" means in practice?  Should we send to
>>> the console the glyph codes corresponding to Unicode points, or should
>>> we send UTF-8 encoded characters?
>> It depends on whether the console is in UTF-8 mode. If so, send UTF-8;
>> if not, send a byte that is transformed according to the current mapping
>> table into a Unicode value. I hope we don't need to bother with the
>> latter possibility.
> What software puts the console in UTF-8 mode?  Is that the locale
> setting?

It's done at boot time. The escape sequences ESC % G (or ESC % 8) and 
ESC % @ get you into and out of UTF-8 mode; see 
<http://man7.org/linux/man-pages/man4/console_codes.4.html>. Common 
practice is to stay in UTF-8 mode as the alternative is worse (it has 
only 256 simultaneously-displayable characters).

> http://www.tldp.org/LDP/LG/issue91/loozzr.html
> http://man7.org/linux/man-pages/man4/console_codes.4.html
> that seems to be just the tip of an iceberg.  Or maybe the
> issue is easier than I envisioned.

Both, I hope. :-)

> Suppose we only wanted to use this feature for UTF-8 locales.
> Assuming that the OS takes care of putting the console in UTF-8 mode,
> we don't need any changes in Emacs, since Emacs already sends UTF-8
> sequences to the screen driver.  As the Linux console only supports
> the BMP, we could then simply amend the code of char-displayable-p to
> check whether a character is within the BMP, when the terminal is the
> Linux console.  Do you agree with this conclusion?

No, because a character is displayable only if it's in that set of 
at-most-512 characters.

> OTOH, now I'm not sure I understand the need for terminal_glyph_code.
> What does it do that a simple check for a Linux console and UTF-8
> terminal encoding, plus a character being inside a BMP, don't?

terminal_glyph_code gets the current set of at-most-512 displayable 
characters from from the kernel.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 14 Apr 2017 12:37:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 14 08:37:26 2017
Received: from localhost ([127.0.0.1]:46589 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cz0Ta-0008Gi-0b
	for submit <at> debbugs.gnu.org; Fri, 14 Apr 2017 08:37:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51012)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cz0TZ-0008GW-0v
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 08:37:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cz0TP-0007E5-Tt
 for 26396 <at> debbugs.gnu.org; Fri, 14 Apr 2017 08:37:15 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58028)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cz0TP-0007Dz-QD; Fri, 14 Apr 2017 08:37:11 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2405
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cz0TP-0001XF-2S; Fri, 14 Apr 2017 08:37:11 -0400
Date: Fri, 14 Apr 2017 15:37:35 +0300
Message-Id: <83inm7go6o.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> (message from
 Paul Eggert on Thu, 13 Apr 2017 13:58:45 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Thu, 13 Apr 2017 13:58:45 -0700
> 
> On 04/13/2017 12:16 AM, Eli Zaretskii wrote:
> > Yes, that would be better.  But it's probably a non-trivial project,
> > since we'd need separate code to determine double-width glyphs,
> > padding glyphs, and perhaps also something special for composed
> > characters.  Does the Linux console allow us to figure out all of
> > that?
> 
> This should not be a problem, as the Linux console has only single-width 
> characters.

Are you sure?  AFAIU, the Linux console supports the BMP, and some of
the characters in the BMP are double-width (a.k.a. "full-width"), for
example U+1100, U+231A, U+2B1B, and others.  What does the Linux
console do when these characters are sent to the screen driver?

> > And what does "display as-is" means in practice?  Should we send to
> > the console the glyph codes corresponding to Unicode points, or should
> > we send UTF-8 encoded characters?
> 
> It depends on whether the console is in UTF-8 mode. If so, send UTF-8; 
> if not, send a byte that is transformed according to the current mapping 
> table into a Unicode value. I hope we don't need to bother with the 
> latter possibility.

What software puts the console in UTF-8 mode?  Is that the locale
setting?

> > (Is there some document which
> > describes these features in enough detail for us to figure out their
> > implications on Emacs display code?)
> 
> Nothing definitive, but there is:
> 
> http://www.tldp.org/LDP/LG/issue91/loozzr.html
> http://man7.org/linux/man-pages/man4/console_codes.4.html

Thanks, but that seems to be just the tip of an iceberg.  Or maybe the
issue is easier than I envisioned.

Suppose we only wanted to use this feature for UTF-8 locales.
Assuming that the OS takes care of putting the console in UTF-8 mode,
we don't need any changes in Emacs, since Emacs already sends UTF-8
sequences to the screen driver.  As the Linux console only supports
the BMP, we could then simply amend the code of char-displayable-p to
check whether a character is within the BMP, when the terminal is the
Linux console.  Do you agree with this conclusion?

OTOH, now I'm not sure I understand the need for terminal_glyph_code.
What does it do that a simple check for a Linux console and UTF-8
terminal encoding, plus a character being inside a BMP, don't?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 14 Apr 2017 03:05:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 23:05:31 2017
Received: from localhost ([127.0.0.1]:46309 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cyrYB-0007oZ-LY
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 23:05:31 -0400
Received: from nm4-vm4.bullet.mail.gq1.yahoo.com ([98.136.218.163]:46429)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1cyrY9-0007oO-RP
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 23:05:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1492139124; bh=uTy4k2/+uVHYKJ3JTViProqdk+EP8TgnXwCwTN/VX7A=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject;
 b=anSGCE35ip5UuIzZY6hWdUfMH3Z2SJTUd/8+mZrte+dFYuZVWHfRBcSRJ34gaRUQdnTWuX4fSjRm2gJECfxfD5u7eTHIlMShZvQaRuCIpt4ePfGyDQYnc6pnbDFwO/AV1R0xgqxgA28jHWP0X2cdgMtOEPMxnxWtg9yrdcorylk2ZIqBNVREswqXri2FUcJlYz++Hk1bwOI1z3t1ycpGYuLbPSWDFK6+ZbrvXW2+lzTEBoMRVSWSdn3lAG8fUspooaYQB4AbVkuQCHs94CIpZ3Phq48NxQJ11cqSjKs1vvWmswzcdQS5g5BkTeu0aqNKe3x1m7SWx+lGzb2IHMI5CA==
Received: from [216.39.60.183] by nm4.bullet.mail.gq1.yahoo.com with NNFMP;
 14 Apr 2017 03:05:24 -0000
Received: from [208.71.42.208] by tm19.bullet.mail.gq1.yahoo.com with NNFMP;
 14 Apr 2017 03:05:24 -0000
Received: from [127.0.0.1] by smtp219.mail.gq1.yahoo.com with NNFMP;
 14 Apr 2017 03:05:24 -0000
X-Yahoo-Newman-Id: 95303.33546.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: RK.hiwsVM1keTEYhJogLpWYxaDa02qe1E5bI21TI_x2VKMP
 3Z8qpLBImKQq4ZXFpFV4s_mcki3GybMrG6ZTZMNsqnfP3nkRqr.1yM97Y.eG
 8m6EF5MTKu04OIo_rDy8iEcAW8iN.JoW2Ts6l0gjj2ifWIGUyfTw0UypbJGh
 xRCwrQjw..BQus9n4xvbs_V1bKpl2A3gduzBs4NmEQROR2FXf.WYigcTX3K_
 rxSB2CmOXEqmy6xIRLZNYUyANjLm0._uQuvl0tuUDm1wfcBq8jtbe13UwKBd
 6pCbEAwuVukFsMyu2.KFk_sOJjchY_Nq616gXOQskoEvt7i0itv_OPuSt4Ag
 rfsq8A5NYGkxnWwqCgO.cpE_ZHLBZllTNKPxWCFXpE.67cGEka2HO2k.c51P
 PhixrykaBdhnYfZuhR87QuR3oaWUK7exYPDQxn.UH503KjdDM5uL38V9DIyC
 cA1o6nR0Ib4x2.2kj2wjvyvlsHUtLlEc42QeZxpXifAJRly2LNoqjXXaNqcf
 EiL6qnn_g8LuBBs0V90CstJUsrI7uOhICi8L8dmJRqzfXZF7Shp41Xs1tXXd 0
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: 26396 <at> debbugs.gnu.org
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <83bms0ixq2.fsf@HIDDEN>
 <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
Date: Fri, 14 Apr 2017 13:01:52 +1000
In-Reply-To: <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN> (Paul Eggert's
 message of "Thu, 13 Apr 2017 13:58:45 -0700")
Message-ID: <87zifj4rq7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 26396
Cc: Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Paul Eggert <eggert@HIDDEN> writes:
>
> It depends on whether the console is in UTF-8 mode.  If so, send UTF-8;
> if not, send a byte that is transformed according to the current
> mapping table into a Unicode value.  I hope we don't need to bother
> with the latter possibility.

The latter is just terminal-coding-system though is it?, which is what
happens now.  Would char-displayable-p always check encodable and then
ponder what further the kernel ioctls can say about viewable glphs.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 13 Apr 2017 22:18:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 18:18:38 2017
Received: from localhost ([127.0.0.1]:46203 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cyn4Y-00019K-Nr
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 18:18:38 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47136)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cyn4X-000197-81
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 18:18:37 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 586AD1600DD;
 Thu, 13 Apr 2017 15:18:30 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 05XNB3imEZ5x; Thu, 13 Apr 2017 15:18:29 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9AC7E1600E7;
 Thu, 13 Apr 2017 15:18:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id QeGPHhL_CWQj; Thu, 13 Apr 2017 15:18:29 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 80B201600DD;
 Thu, 13 Apr 2017 15:18:29 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: rms@HIDDEN
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
 <E1cymtr-0003Ac-Kj@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <ae92fb7c-d501-0c08-c325-407be5a48022@HIDDEN>
Date: Thu, 13 Apr 2017 15:18:29 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <E1cymtr-0003Ac-Kj@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, eliz@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/13/2017 03:07 PM, Richard Stallman wrote:
>    > Wouldn't it be better if Emacs ignored terminal-coding-system when the output
>    > device is a Linux console and Emacs therefore knows exactly which characters the
>    > console can display?
>
> Does Emacs always know for certain?
If Emacs is attached directly to a console, yes. There's already some 
code that does this, by using Linux-specific syscalls.

> What if it is talking to that console via ssh?

Then Emacs won't know, and will fall back on generic terminal code. 
However, the case that prompted this thread is where part of Emacs does 
know and part does not, and the mismatch causes a problem. I'm proposing 
that different parts of Emacs treat Linux consoles more consistently.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 13 Apr 2017 22:07:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 18:07:48 2017
Received: from localhost ([127.0.0.1]:46198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cymu4-0000ta-LS
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 18:07:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1cymu3-0000tP-Ba
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 18:07:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rms@HIDDEN>) id 1cymtx-0008LP-Am
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 18:07:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39221)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>)
 id 1cymts-0008FO-6W; Thu, 13 Apr 2017 18:07:36 -0400
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1cymtr-0003Ac-Kj; Thu, 13 Apr 2017 18:07:35 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> (message from
 Paul Eggert on Wed, 12 Apr 2017 23:19:53 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN> <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
Message-Id: <E1cymtr-0003Ac-Kj@HIDDEN>
Date: Thu, 13 Apr 2017 18:07:35 -0400
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, eliz@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Wouldn't it be better if Emacs ignored terminal-coding-system when the output 
  > device is a Linux console and Emacs therefore knows exactly which characters the 
  > console can display?

Does Emacs always know for certain?

What if it is talking to that console via ssh?

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 13 Apr 2017 20:58:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 16:58:56 2017
Received: from localhost ([127.0.0.1]:46128 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cylpQ-0007d5-BK
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 16:58:56 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cylpO-0007ct-QI
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 16:58:55 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 168BB1600E7;
 Thu, 13 Apr 2017 13:58:47 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id rKKL-315uKnJ; Thu, 13 Apr 2017 13:58:45 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id CE4231600DA;
 Thu, 13 Apr 2017 13:58:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id PqPZZLeH1sGE; Thu, 13 Apr 2017 13:58:45 -0700 (PDT)
Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B45C61600D2;
 Thu, 13 Apr 2017 13:58:45 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> <83bms0ixq2.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <f4802606-22ee-3cb8-654b-8b8c3ab2dfe7@HIDDEN>
Date: Thu, 13 Apr 2017 13:58:45 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <83bms0ixq2.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 04/13/2017 12:16 AM, Eli Zaretskii wrote:
> Yes, that would be better.  But it's probably a non-trivial project,
> since we'd need separate code to determine double-width glyphs,
> padding glyphs, and perhaps also something special for composed
> characters.  Does the Linux console allow us to figure out all of
> that?

This should not be a problem, as the Linux console has only single-width 
characters.

>
> And what does "display as-is" means in practice?  Should we send to
> the console the glyph codes corresponding to Unicode points, or should
> we send UTF-8 encoded characters?

It depends on whether the console is in UTF-8 mode. If so, send UTF-8; 
if not, send a byte that is transformed according to the current mapping 
table into a Unicode value. I hope we don't need to bother with the 
latter possibility.

> (Is there some document which
> describes these features in enough detail for us to figure out their
> implications on Emacs display code?)

Nothing definitive, but there is:

http://www.tldp.org/LDP/LG/issue91/loozzr.html
http://man7.org/linux/man-pages/man4/console_codes.4.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 13 Apr 2017 07:16:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 03:16:10 2017
Received: from localhost ([127.0.0.1]:45017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cyYzC-0005aH-CX
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 03:16:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45029)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cyYzA-0005a4-MG
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 03:16:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cyYz2-0006sD-GL
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 03:16:03 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55955)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cyYz2-0006s9-Cp; Thu, 13 Apr 2017 03:16:00 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2016
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cyYz0-0005gx-VT; Thu, 13 Apr 2017 03:15:59 -0400
Date: Thu, 13 Apr 2017 10:16:21 +0300
Message-Id: <83bms0ixq2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-reply-to: <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN> (message from
 Paul Eggert on Wed, 12 Apr 2017 23:19:53 -0700)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
 <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: user42_kevin@HIDDEN, 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Cc: 26396 <at> debbugs.gnu.org
> From: Paul Eggert <eggert@HIDDEN>
> Date: Wed, 12 Apr 2017 23:19:53 -0700
> 
> Eli Zaretskii wrote:
> > I think the code in
> > char-displayable-p which looks at the result of internal-char-font
> > should only accept a non-negative value if the terminal-coding-system
> > supports the character.  IOW, the Linux console should not be
> > considered as being able to display a character unless the terminal
> > encoding can safely encode it.
> 
> Wouldn't it be better if Emacs ignored terminal-coding-system when the output 
> device is a Linux console and Emacs therefore knows exactly which characters the 
> console can display? Instead, Emacs could simply display those characters as-is. 

Yes, that would be better.  But it's probably a non-trivial project,
since we'd need separate code to determine double-width glyphs,
padding glyphs, and perhaps also something special for composed
characters.  Does the Linux console allow us to figure out all of
that?

And what does "display as-is" means in practice?  Should we send to
the console the glyph codes corresponding to Unicode points, or should
we send UTF-8 encoded characters?  (Is there some document which
describes these features in enough detail for us to figure out their
implications on Emacs display code?)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 13 Apr 2017 06:20:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 13 02:20:02 2017
Received: from localhost ([127.0.0.1]:44987 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cyY6s-00043c-7f
	for submit <at> debbugs.gnu.org; Thu, 13 Apr 2017 02:20:02 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55262)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1cyY6q-00042x-FJ
 for 26396 <at> debbugs.gnu.org; Thu, 13 Apr 2017 02:20:01 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8E8071604F1;
 Wed, 12 Apr 2017 23:19:54 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 0DZCoZBFcurj; Wed, 12 Apr 2017 23:19:53 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id A60481604F2;
 Wed, 12 Apr 2017 23:19:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id jUyMNP4veU52; Wed, 12 Apr 2017 23:19:53 -0700 (PDT)
Received: from [192.168.1.9] (unknown [47.153.188.248])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 88B441604F1;
 Wed, 12 Apr 2017 23:19:53 -0700 (PDT)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
To: Eli Zaretskii <eliz@HIDDEN>, user42_kevin@HIDDEN
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN> <83fuhglp42.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <47a950c4-2a4b-dfab-36e4-2b691b406b5f@HIDDEN>
Date: Wed, 12 Apr 2017 23:19:53 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <83fuhglp42.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 26396
Cc: 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

Eli Zaretskii wrote:
> I think the code in
> char-displayable-p which looks at the result of internal-char-font
> should only accept a non-negative value if the terminal-coding-system
> supports the character.  IOW, the Linux console should not be
> considered as being able to display a character unless the terminal
> encoding can safely encode it.

Wouldn't it be better if Emacs ignored terminal-coding-system when the output 
device is a Linux console and Emacs therefore knows exactly which characters the 
console can display? Instead, Emacs could simply display those characters as-is. 
This would result in a better user experience, surely.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 11 Apr 2017 07:25:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 11 03:25:53 2017
Received: from localhost ([127.0.0.1]:41893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cxqBV-0003lV-92
	for submit <at> debbugs.gnu.org; Tue, 11 Apr 2017 03:25:53 -0400
Received: from nm19-vm1.bullet.mail.gq1.yahoo.com ([98.136.217.24]:60172)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1cxqBT-0003lH-Gq
 for 26396 <at> debbugs.gnu.org; Tue, 11 Apr 2017 03:25:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1491895545; bh=8GhxHB1gBw2OfTqhKTHoxD95nLxiB9XUJcP2z/QhnhA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject;
 b=KIFaA60nzrN2tTlz3vyxfbVg6fMOvzZ8SS/299Tzz7RZE7tEEOd638a7/KCydsvBjhtNemxtUBJauMlcGXN+dvAGblUSNpS7ABbPdQTPNbmLCXbm46DDc2vJOMUQoTStBZtTlY8PFo4HgGRMg/cWJjWzhIvX7UbwtMvIxUi/Uq7H9AZNDIhybiiS9ONfvmx0a1n+MO47SBIzwhO64UbUWiPTtWOPLjAx3QWfUABhNZ7LTAcFtYDQgxi0uihCnm2whO6ehp+ap8rK/6SlInIx1KEw82O2ZcfkFiABePQDphkzktWrmLFUIh3VynbC8K2Co2vGHG+EGdM9OUfg+d7kJQ==
Received: from [98.137.12.59] by nm19.bullet.mail.gq1.yahoo.com with NNFMP;
 11 Apr 2017 07:25:45 -0000
Received: from [208.71.42.195] by tm4.bullet.mail.gq1.yahoo.com with NNFMP;
 11 Apr 2017 07:25:45 -0000
Received: from [127.0.0.1] by smtp206.mail.gq1.yahoo.com with NNFMP;
 11 Apr 2017 07:25:45 -0000
X-Yahoo-Newman-Id: 658221.81554.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: cyIFRiEVM1nXWlr2xroHjzphLurRy0oqHTsOcel2AyU1fK8
 u9IVk_J4ie.Dp3Ld.xUASoSjImT3CZ9V5E.rs0P4Y0TXEX8Z86VgzwVim1XG
 ZltTD2x0PQVE9.i1c6M_q8EgWe3qZsfO1SYrffGBWLedr9SaVEv8B1s57HXk
 NyDg3irOwyCb92CTnLXk2xUa7TjJ2HK90UY6LpEkjnSsQqZaWwNjeRiy2DfG
 HZHb89oNsc3hDWWfuaKORON2Dx0oPQeqAACZyu7cjBLsJy4UOwXqcfckLqAB
 j.RBiu4GKwFvczRuWx7I857RB6SXVwy1pMgXmdTT3Sa9H18Kyg9.Z7lwgPfj
 rgD.ZldweRlJZNT02wv9978PMpSPF1QcigbKnVZDbNH0sX8IrJKrB4kg.tN1
 64SHeNnMnFyx2kMeSEnh2Bjeweh7qOxcuTZ2D3zMZ8ZbMCwMXa3AyjUmdvMO
 6h6nKhRri1rCZNRA8A0Adb8HRUv0W8gCs4.xZsexenf5vziA_m2GXo1yCNaw
 PjICr9raIP0lVwuUf264dFMK4NJwKMAt03xxZMymQ5IBqIVurLvby2eRFVs0 -
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: 26396 <at> debbugs.gnu.org
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
Date: Tue, 11 Apr 2017 17:22:52 +1000
In-Reply-To: <83h91wlpws.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 10 Apr
 2017 09:47:47 +0300")
Message-ID: <8737dfl86r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.8 (--)
X-Debbugs-Envelope-To: 26396
Cc: eggert@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.8 (--)

Eli Zaretskii <eliz@HIDDEN> writes:
>
>
> Ah, I think I see the problem: the console indeed supports that
> character, but since terminal-coding-system is latin-1, it cannot
> encode it, so you see a question mark instead, is that right?

I get the emacs \x1234 escapes.  (I might have preferred question marks
... I'm trying glyphless-char-display fallback slot as thin-space to see
if I like that better.)

I suppose \x suggests the emacs display code knows it can't show
(because can't encode it as you say) but char-displayable-p doesn't
correspond.

> GIO_UNIMAP ...

I'm not familiar with that.  It's what parts of unicode have font glyphs
available is it?  I suppose that'd be a double condition for
char-displayable-p, must be able to encode under term-coding-system, and
on the console in addition can verify there's a glyph.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 10 Apr 2017 07:45:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 10 03:45:50 2017
Received: from localhost ([127.0.0.1]:40504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cxU1G-0006MC-NP
	for submit <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:45:50 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48423)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cxU1E-0006Lz-QL
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:45:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cxU14-0007lX-G1
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:45:43 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34931)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cxU14-0007lQ-97; Mon, 10 Apr 2017 03:45:38 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2062
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cxU13-0004EK-FK; Mon, 10 Apr 2017 03:45:37 -0400
Date: Mon, 10 Apr 2017 10:45:52 +0300
Message-Id: <83d1ckln7z.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: eggert@HIDDEN, user42_kevin@HIDDEN
In-reply-to: <83fuhglp42.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 10
 Apr 2017 10:05:01 +0300)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
 <83fuhglp42.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Mon, 10 Apr 2017 10:05:01 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 26396 <at> debbugs.gnu.org
> 
> Paul, could you please look into this?  I think the code in
> char-displayable-p which looks at the result of internal-char-font
> should only accept a non-negative value if the terminal-coding-system
> supports the character.  IOW, the Linux console should not be
> considered as being able to display a character unless the terminal
> encoding can safely encode it.

Or maybe the result of internal-char-font should be accepted only if
the terminal encoding is UTF-8 or some other Unicode encoding.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 10 Apr 2017 07:05:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 10 03:05:03 2017
Received: from localhost ([127.0.0.1]:40462 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cxTNn-0005MM-ME
	for submit <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:05:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37206)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cxTNm-0005Lq-3k
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:05:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cxTNc-00085I-DN
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 03:04:56 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34447)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cxTNc-00085E-9a; Mon, 10 Apr 2017 03:04:52 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1969
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cxTNX-0006Ms-M4; Mon, 10 Apr 2017 03:04:48 -0400
Date: Mon, 10 Apr 2017 10:05:01 +0300
Message-Id: <83fuhglp42.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>, user42_kevin@HIDDEN
In-reply-to: <83h91wlpws.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 10
 Apr 2017 09:47:47 +0300)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN> <83h91wlpws.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 26396 <at> debbugs.gnu.org
> 
> > From: Kevin Ryde <user42_kevin@HIDDEN>
> > Date: Sun, 09 Apr 2017 15:16:18 +1000
> > 
> > > Please step through char-displayable-p, and see what
> > > doesn't work there in your case.
> > 
> > Ah, it gets to (internal-char-font nil #x2022) = 7, which goes to the
> > (<= 0 font-glyph) case and is t, not the terminal-coding-system checking
> > case.
> 
> Then Emacs is doing TRT, AFAICT: it uses the GIO_UNIMAP that's
> available on your system to query the kernel about characters
> displayable by the console.  Are you saying that as a matter of fact
> that character cannot be displayed by the console, i.e. that the code
> which uses GIO_UNIMAP somehow misbehaves?

Ah, I think I see the problem: the console indeed supports that
character, but since terminal-coding-system is latin-1, it cannot
encode it, so you see a question mark instead, is that right?

Paul, could you please look into this?  I think the code in
char-displayable-p which looks at the result of internal-char-font
should only accept a non-negative value if the terminal-coding-system
supports the character.  IOW, the Linux console should not be
considered as being able to display a character unless the terminal
encoding can safely encode it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 10 Apr 2017 06:47:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 10 02:47:45 2017
Received: from localhost ([127.0.0.1]:40449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cxT72-0004wW-U5
	for submit <at> debbugs.gnu.org; Mon, 10 Apr 2017 02:47:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33739)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cxT71-0004wI-E8
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 02:47:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cxT6t-0002O0-11
 for 26396 <at> debbugs.gnu.org; Mon, 10 Apr 2017 02:47:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34275)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cxT6s-0002Nw-Us; Mon, 10 Apr 2017 02:47:34 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1955
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cxT6r-0007Rw-LK; Mon, 10 Apr 2017 02:47:34 -0400
Date: Mon, 10 Apr 2017 09:47:47 +0300
Message-Id: <83h91wlpws.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Kevin Ryde <user42_kevin@HIDDEN>
In-reply-to: <87k26u9n4t.fsf@HIDDEN> (message from Kevin Ryde on Sun, 09
 Apr 2017 15:16:18 +1000)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
 <87k26u9n4t.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Kevin Ryde <user42_kevin@HIDDEN>
> Date: Sun, 09 Apr 2017 15:16:18 +1000
> 
> > Please step through char-displayable-p, and see what
> > doesn't work there in your case.
> 
> Ah, it gets to (internal-char-font nil #x2022) = 7, which goes to the
> (<= 0 font-glyph) case and is t, not the terminal-coding-system checking
> case.

Then Emacs is doing TRT, AFAICT: it uses the GIO_UNIMAP that's
available on your system to query the kernel about characters
displayable by the console.  Are you saying that as a matter of fact
that character cannot be displayed by the console, i.e. that the code
which uses GIO_UNIMAP somehow misbehaves?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 9 Apr 2017 05:18:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 09 01:18:43 2017
Received: from localhost ([127.0.0.1]:38785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cx5FL-0007is-8K
	for submit <at> debbugs.gnu.org; Sun, 09 Apr 2017 01:18:43 -0400
Received: from nm15-vm6.bullet.mail.gq1.yahoo.com ([98.137.176.78]:34423)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1cx5FJ-0007ic-6M
 for 26396 <at> debbugs.gnu.org; Sun, 09 Apr 2017 01:18:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1491715114; bh=0MAUFZ8GHiUTQYYzIVuorGDrWxUdaSujKr35kajTFac=;
 h=From:To:Subject:References:Date:In-Reply-To:From:Subject;
 b=T9Jo2Idv7AQ7JRdFlDaJiTS6PU+bf/BLCOSIYaP2p6N0HaN1hdo6prephV8MkHX6RyXPox+jezbZTJ4oY3hT6t1GPsxVdKgQFbpVTPp9tGnM0HmuSaXphdvqIN8XE+3nt58TKf+58EopO36Qix77VTQo0hiIzZD84Zu3QORtNTzdr2JjwLrnt8HcJr1KeKG0tNEMOb2aswRMvh2FxsrDq2ri4CqAsS/FHXjoNMxAcm317j2aJXWfFK1CBHrpVdFT+hbJVg4juyWyZSTw+ieaObhBsJ815m3Aed/nIpshWMX+BY7lZlMwvrTb9xjVHvrnbseLBQN71wB2hvDJGqJJPg==
Received: from [98.137.12.174] by nm15.bullet.mail.gq1.yahoo.com with NNFMP;
 09 Apr 2017 05:18:34 -0000
Received: from [98.136.164.64] by tm13.bullet.mail.gq1.yahoo.com with NNFMP;
 09 Apr 2017 05:18:34 -0000
Received: from [127.0.0.1] by smtp226.mail.gq1.yahoo.com with NNFMP;
 09 Apr 2017 05:18:34 -0000
X-Yahoo-Newman-Id: 676195.53166.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: I_Rey2sVM1mM231gzEQrCAbqKk1BfAvdh2sMI1nWbQoxpp7
 oEwLFF6cgQNpbKC7QXXLE.UiPUdmE5ZQ2R8DdW1hJNaTlPEhHrUh71Gped_5
 a4bRjjIvXVHliWH1lj7CiFPdvMWzunWt75058.aJ7Nr0o2ewswIoXRrsmJ2Q
 Hmv2l2OndivOWtaiV4UUL5ClTr..MeVjTqKbGS.up9BANDu2qKpMFDqiZ.f2
 8IM4s6KZObH.fUc1FJupgEfgmVSgTjE3EtSXynRdyosHI.pBugZtXydsnlpg
 fgDIng9fwEVp6vcNL_1ZnfnGikpHB.pUSbODOkJu.LMYLcfVarz_nZuVBe1g
 F54LZ.2d0fnJGyYVU45RG7yOJYkTIBivL28rbJr7Ch3Zd.Kai9gPqtj2jdE6
 fhHUY4c13PjP7Fx6T603tlHp5jyqQHSyGYRlY4kY.PeYw.64AIhjIHvXVx7M
 vpnEWwmKnhrHgEEYFyPDtK6w2tOQaepT..jxuuaKcUQJQitR2wnDsKWEUOSn
 wtttyrJycDOH0q4fNjENKhJqD_v4LBHrKGA0rvB3JXoDtJHP5RvWKf3A0wUD V
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: 26396 <at> debbugs.gnu.org
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN> <83o9w7mjlj.fsf@HIDDEN>
Date: Sun, 09 Apr 2017 15:16:18 +1000
In-Reply-To: <83o9w7mjlj.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 08 Apr
 2017 10:42:00 +0300")
Message-ID: <87k26u9n4t.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: 26396
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.5 (---)

Eli Zaretskii <eliz@HIDDEN> writes:
>
>   emacs-25.1 -Q -nw
>   C-x RET t latin-1 RET
>   M-: (char-displayable-p #x2022) RET
>
> and the result was nil.

Ah, yes, me too under X and -nw in an xterm.

> How is the above different from what you tried?

Oops sorry not to say, this is linux console tty and LANG=en_AU.iso88591
so that (terminal-coding-system) is iso-latin-1-unix on startup.  It's
the linux fbcon thingie I think, but hope that doesn't make a
difference.  The effect (getting t) seems the same if the term coding is
set by C-x ret t later too like you showed.

> Please step through char-displayable-p, and see what
> doesn't work there in your case.

Ah, it gets to (internal-char-font nil #x2022) = 7, which goes to the
(<= 0 font-glyph) case and is t, not the terminal-coding-system checking
case.  If forced to the latter case it comes out nil as I had hoped.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at 26396 <at> debbugs.gnu.org:


Received: (at 26396) by debbugs.gnu.org; 8 Apr 2017 07:42:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 08 03:42:01 2017
Received: from localhost ([127.0.0.1]:37033 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cwl0T-0004vq-9r
	for submit <at> debbugs.gnu.org; Sat, 08 Apr 2017 03:42:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34193)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cwl0S-0004vf-9w
 for 26396 <at> debbugs.gnu.org; Sat, 08 Apr 2017 03:42:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cwl0J-0003NL-87
 for 26396 <at> debbugs.gnu.org; Sat, 08 Apr 2017 03:41:55 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38004)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cwl0J-0003N7-4J; Sat, 08 Apr 2017 03:41:51 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1553
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cwl0I-0000CY-Cn; Sat, 08 Apr 2017 03:41:50 -0400
Date: Sat, 08 Apr 2017 10:42:00 +0300
Message-Id: <83o9w7mjlj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Kevin Ryde <user42_kevin@HIDDEN>
In-reply-to: <87efx31vxy.fsf@HIDDEN> (message from Kevin Ryde on Sat, 08
 Apr 2017 12:20:57 +1000)
Subject: Re: bug#26396: 25.1; char-displayable-p on a latin1 tty
References: <87efx31vxy.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 26396
Cc: 26396 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Kevin Ryde <user42_kevin@HIDDEN>
> Date: Sat, 08 Apr 2017 12:20:57 +1000
> 
> On a latin1 tty, char-displayable-p claims that almost all chars are
> displayable, eg (char-displayable-p #x2022) => t.

I cannot reproduce this.  I did

  emacs-25.1 -Q -nw
  C-x RET t latin-1 RET
  M-: (char-displayable-p #x2022) RET

and the result was nil.  How is the above different from what you
tried?

> I hoped when (terminal-coding-system) is iso-latin-1-unix that
> char-displayable-p would say only relevant latin1 chars are displayable.

It should be.  Please step through char-displayable-p, and see what
doesn't work there in your case.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Apr 2017 02:23:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 07 22:23:14 2017
Received: from localhost ([127.0.0.1]:36925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cwg1y-0005Tu-05
	for submit <at> debbugs.gnu.org; Fri, 07 Apr 2017 22:23:14 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56593)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <user42_kevin@HIDDEN>) id 1cwg1w-0005Th-P8
 for submit <at> debbugs.gnu.org; Fri, 07 Apr 2017 22:23:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <user42_kevin@HIDDEN>) id 1cwg1q-0005ZM-VH
 for submit <at> debbugs.gnu.org; Fri, 07 Apr 2017 22:23:07 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:35835)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <user42_kevin@HIDDEN>)
 id 1cwg1q-0005Z6-Rg
 for submit <at> debbugs.gnu.org; Fri, 07 Apr 2017 22:23:06 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47561)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <user42_kevin@HIDDEN>) id 1cwg1p-0002T2-SM
 for bug-gnu-emacs@HIDDEN; Fri, 07 Apr 2017 22:23:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <user42_kevin@HIDDEN>) id 1cwg1k-0005UC-VJ
 for bug-gnu-emacs@HIDDEN; Fri, 07 Apr 2017 22:23:05 -0400
Received: from nm26-vm7.bullet.mail.gq1.yahoo.com ([98.136.216.134]:60580)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)
 (envelope-from <user42_kevin@HIDDEN>) id 1cwg1k-0005Tm-Fh
 for bug-gnu-emacs@HIDDEN; Fri, 07 Apr 2017 22:23:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048;
 t=1491618178; bh=U3hfX3/h808dbBp2Rf39b5SwneMzQMOQOYYGWTk49h4=;
 h=From:To:Subject:Date:From:Subject;
 b=Gp0spfZBkleNMCnVEmzRTDR8REKrcq3JAYdUxTAS6LX+GWvlN1x0sArVGTwOg0pMx3sZecw53DhDZMri0cH6YIXkAM0Yl32x/xLZIwO+9ANCPS/uBGbIl8VyblgjKMvKiiJzVcIfOQ1QRx1barb3gbsG+fHXt2LyFyg/pE1vsWCVeYT4NwyMaeDMsMTSJr+qqkqztoBDaqCZvVNuXXHzveugpVPG7nQ28Cc2UwXjFOsmbXyWQOcd0EUmy56zcjSvF1MmUgQ1uansnPVhRkCziFWUTzqsXrcuXpACh14Cy+/IHj3czU6meh71JXBPksTGUDfe9+OaYeKXV3XcKFPPfw==
Received: from [98.137.12.191] by nm26.bullet.mail.gq1.yahoo.com with NNFMP;
 08 Apr 2017 02:22:58 -0000
Received: from [208.71.42.197] by tm12.bullet.mail.gq1.yahoo.com with NNFMP;
 08 Apr 2017 02:22:58 -0000
Received: from [127.0.0.1] by smtp208.mail.gq1.yahoo.com with NNFMP;
 08 Apr 2017 02:22:58 -0000
X-Yahoo-Newman-Id: 512249.31998.bm@HIDDEN
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: 5KhqmHkVM1l8_6YBumLmHYrDZxO3rq.Ir29fw44c2yrmXmx
 ZHjxGIlLKgkNHna_yWCtg8oMtU5fHi1AlrhP12VcTi_F81igFQuel0g5v5s.
 oNZi1RWWFEd3dEtuKnvUnjL.m8DkWS0Ifh6ehwKns23Q2IJxOmna9EbHbXRa
 F2Mo.jckGB4E_aV.B3Jx2usYnxaNK3lITfCtbB_GJAO7QfRuszwyXitxAXKO
 MmwTQ3DfNwFDUErEoZF7WqZJ6iTFW.0Quy6mYRfiomFnj.gkem.Sn06n_XFT
 poE6o93yS10U5vUryaCyNfdr._5v5rQ.eAIGnyDeNOdyU2zvsqYUS5XNiY4u
 2mlbqqvCY3U7ew2sHrJj4OPxv.8XoZtdxJpLlJzEov75gnD.w99EHOAKmcD.
 l83crR1Gn_xgt7t8ilEkLfoW07dkr8DTkF_tU.6d.UpvtC_iz1zLu7c5OYXe
 VTyeMiDEw6JvFjRnOJ_VXF1dR_03WKzw040cWkH7.K_f9D.tCGCuOMRLmlnV
 jwGnlZybO_W1DBKUJ3HiKARAAfOej7q2zaO5dEnL7M3smZKJy0bETB3SN6jB r
X-Yahoo-SMTP: U8NKAo6swBAxDIMUovTitGGHebxdYQBZ5A--
From: Kevin Ryde <user42_kevin@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.1; char-displayable-p on a latin1 tty
Date: Sat, 08 Apr 2017 12:20:57 +1000
Message-ID: <87efx31vxy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.4 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.4 (----)

On a latin1 tty, char-displayable-p claims that almost all chars are
displayable, eg (char-displayable-p #x2022) => t.

I hoped when (terminal-coding-system) is iso-latin-1-unix that
char-displayable-p would say only relevant latin1 chars are displayable.

I believe this is how it was in emacs24 was (and which helped avoid a
lot of very unattractive \ display escaping, at least from code knowing
not to try to display the undisplayable).


In GNU Emacs 25.1.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-01-01, modified by Debian built on x86-csail-01

Important settings:
  value of $LANG: en_AU.iso88591
  locale-coding-system: iso-latin-1-unix




Acknowledgement sent to Kevin Ryde <user42_kevin@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#26396; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.