From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#26396: 25.1; char-displayable-p on a latin1 tty Date: Sun, 16 Apr 2017 22:56:08 -0700 Organization: UCLA Computer Science Department Message-ID: <081710d5-c33c-c8af-fc4b-561594056f3e@cs.ucla.edu> References: <87efx31vxy.fsf@blah.blah> <83o9w7mjlj.fsf@gnu.org> <87k26u9n4t.fsf@blah.blah> <83h91wlpws.fsf@gnu.org> <83fuhglp42.fsf@gnu.org> <47a950c4-2a4b-dfab-36e4-2b691b406b5f@cs.ucla.edu> <83bms0ixq2.fsf@gnu.org> <83inm7go6o.fsf@gnu.org> <24bd0681-08d5-137f-29df-715eefddf2ae@cs.ucla.edu> <834lxqgipc.fsf@gnu.org> <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@cs.ucla.edu> <83o9vwgafr.fsf@gnu.org> <87k26jd9ho.fsf@blah.blah> <2685c665-652c-644a-9550-e0e283d9f315@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C106BA4A5E542D39BCA0BD84" X-Trace: blaine.gmane.org 1492408632 30402 195.159.176.226 (17 Apr 2017 05:57:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Apr 2017 05:57:12 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: Kevin Ryde , 26396@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 17 07:57:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czzeu-0007oG-AW for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Apr 2017 07:57:08 +0200 Original-Received: from localhost ([::1]:34953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czzf0-0001Fu-5D for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Apr 2017 01:57:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1czzet-0001El-MM for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2017 01:57:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1czzeo-0008Gi-QU for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2017 01:57:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53098) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1czzeo-0008Ga-MP for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2017 01:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1czzeo-0007f3-AS for bug-gnu-emacs@gnu.org; Mon, 17 Apr 2017 01:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Apr 2017 05:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26396-submit@debbugs.gnu.org id=B26396.149240857729397 (code B ref 26396); Mon, 17 Apr 2017 05:57:02 +0000 Original-Received: (at 26396) by debbugs.gnu.org; 17 Apr 2017 05:56:17 +0000 Original-Received: from localhost ([127.0.0.1]:51297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czze5-0007e4-Cf for submit@debbugs.gnu.org; Mon, 17 Apr 2017 01:56:17 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1czze4-0007do-5W for 26396@debbugs.gnu.org; Mon, 17 Apr 2017 01:56:16 -0400 Original-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) Original-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) Original-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 Original-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) Original-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) In-Reply-To: <2685c665-652c-644a-9550-e0e283d9f315@cs.ucla.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131668 Archived-At: 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 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--