unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: user42_kevin@yahoo.com.au, 26396@debbugs.gnu.org
Subject: bug#26396: 25.1; char-displayable-p on a latin1 tty
Date: Sun, 16 Apr 2017 08:59:04 +0300	[thread overview]
Message-ID: <83o9vwgafr.fsf@gnu.org> (raw)
In-Reply-To: <11cfdd58-d2c2-b32f-ecc3-eb86db6711b8@cs.ucla.edu> (message from Paul Eggert on Sat, 15 Apr 2017 14:12:40 -0700)

> Cc: user42_kevin@yahoo.com.au, 26396@debbugs.gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 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.





  reply	other threads:[~2017-04-16  5:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08  2:20 bug#26396: 25.1; char-displayable-p on a latin1 tty Kevin Ryde
2017-04-08  7:42 ` Eli Zaretskii
2017-04-09  5:16   ` Kevin Ryde
2017-04-10  6:47     ` Eli Zaretskii
2017-04-10  7:05       ` Eli Zaretskii
2017-04-10  7:45         ` Eli Zaretskii
2017-04-13  6:19         ` Paul Eggert
2017-04-13  7:16           ` Eli Zaretskii
2017-04-13 20:58             ` Paul Eggert
2017-04-14  3:01               ` Kevin Ryde
2017-04-14 18:59                 ` Paul Eggert
2017-04-14 12:37               ` Eli Zaretskii
2017-04-14 18:56                 ` Paul Eggert
2017-04-15  8:48                   ` Eli Zaretskii
2017-04-15 21:12                     ` Paul Eggert
2017-04-16  5:59                       ` Eli Zaretskii [this message]
2017-04-16 20:25                         ` Paul Eggert
2017-04-17  6:19                           ` Eli Zaretskii
2017-04-17  3:00                         ` Kevin Ryde
2017-04-17  3:26                           ` Paul Eggert
2017-04-17  5:56                             ` Paul Eggert
2017-04-17  7:33                               ` Eli Zaretskii
2017-04-17 17:22                                 ` Paul Eggert
2017-04-17  6:24                             ` Eli Zaretskii
2017-04-17  6:41                               ` Paul Eggert
2017-04-17  7:27                                 ` Kevin Ryde
2017-04-17  8:08                                 ` Eli Zaretskii
2017-04-17 18:08                                   ` Paul Eggert
2017-04-17 18:32                                     ` Eli Zaretskii
2017-04-18 17:49                                       ` Paul Eggert
2017-04-18 18:19                                         ` Eli Zaretskii
2017-04-13 22:07           ` Richard Stallman
2017-04-13 22:18             ` Paul Eggert
2017-04-14 19:48               ` Richard Stallman
2017-04-11  7:22       ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o9vwgafr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=26396@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=user42_kevin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).