unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Aura Kelloniemi <kaura.dev@sange.fi>
Cc: 54032@debbugs.gnu.org
Subject: bug#54032: 29.0.50; Emoji display on Linux console switched to hexadecimal output
Date: Thu, 17 Feb 2022 09:52:15 +0200	[thread overview]
Message-ID: <83ilte0w28.fsf@gnu.org> (raw)
In-Reply-To: <87h78y56aj.fsf@sange.fi> (message from Aura Kelloniemi on Thu, 17 Feb 2022 08:57:40 +0200)

> From: Aura Kelloniemi <kaura.dev@sange.fi>
> Date: Thu, 17 Feb 2022 08:57:40 +0200
> 
> on recent Emacs development repository builds, emoji characters are no more
> displayed on Linux console. Instead Emacs prints \UABCDEF hexadecimal codes.
> 
> This is due to the commit 10c680551e899805a6de7360e9b65986fd87df72 which
> probably makes things better on some terminals. Reverting this commit fixed
> the issue for me, and emojis are again displayed as usual.

Thanks, but I think we need more detailed information to understand
the problem.  First, when you say "display emoji characters", which
characters exactly does that allude to?  Can you show specific
examples of text that includes Emoji, which displayed the Emoji glyphs
before the above commit, but not after it?  In particular, are we
talking about single codepoints in the Emoji block, or are we talking
about Emoji sequences that involve more than one codepoint (and are
supposed to display like a single Emoji glyph)?  For each example,
please show both the text and what you see on display for that text.

Also, what is the value of auto-composition-mode?  I think it should
be the string "linux", in which case please try setting it to t and
see if the display becomes better or worse.

> Linux console is (sort of) capable of displaying emojis. Console font can be
> configured so that it has glyphs for emojis exactly the same way as for other
> characters.

If that is the case, why did Emacs think the terminal cannot display
these characters?  Can you step with GDB inside terminal_glyph_code,
when it is called for the first time in the Emacs session, and see
whether the ioctl call we issue in calculate_glyph_code_table returns
valid values for the Emoji codepoints?

> Also, blind users using refreshable braile displays use Linux
> console to access Emacs. The braille terminal driver is able to detect the
> correct character code points even when Linux itself is not able to display
> them properly on the screen. This detection is done using the /dev/vcsu
> (virtual console screen unicode) character devices.

Are you saying that the braille terminal driver will not respond to
the ioctl call we issue in calculate_glyph_code_table?  Is there any
other method of knowing which characters are supported in that case?

> For these reasons it is important that emacs outputs the real
> characters to the terminal on Linux console.

Outputting codepoints for which there are no glyphs produced
unreadable display, since (AFAIU) the console displays them all as the
"diamond" replacement character.  Detecting the fact that a codepoint
cannot be displayed allows us to produce something that at least can
be interpreted, and allows the user to install optional features (such
as those provided by latin1-disp.el) which will replace the characters
that cannot be displayed by equivalent strings, for example ASCII
strings.

So we would like to keep the automatic detection of whether a given
character can be displayed by the console, although it sounds like the
current solution should be made more flexible and sophisticated in
some way.

> Linux console has a terminal type string of "linux". lisp/term/linux.el
> contains already some Linux terminal specific code (which unfortunately
> assumes though that Linux has a default character set of Latin-1, which has
> never been true).

That's just the default.  We attempt to detect which characters can be
displayed later on, when the functions I mentioned above are called
during startup.

> My preferred solution to this problem would be to add and document a way to
> configure character display logic on TTYs more precisely. It would be great to
> be able to control the terminal output of Unicode on grapheme cluster
> precision – i.e. allow the user to define a function which translates code
> points/grapheme clusters into something that their terminal can display.

I'm not yet sure something like that would be needed.  It will
certainly slow down the display on the console, which is undesirable
for obvious reasons.  It is also too complex (not every Emacs user can
write Lisp programs that play sophisticated games with characters and
glyphs).

I think we don't yet have a detailed enough understanding of the issue
to discuss solutions, so I suggest to postpone this discussion until
the questions I asked above are answered, and we have a good
understanding of what is going on.

The commit to which you point out was made based on reports from
another user of the Linux console (albeit not about Emoji), and in
that case the change had a positive effect.  So the issue is not
simple, and we need a good understanding of it before we devise a
solution.

Thanks.





      reply	other threads:[~2022-02-17  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17  6:57 bug#54032: 29.0.50; Emoji display on Linux console switched to hexadecimal output Aura Kelloniemi
2022-02-17  7:52 ` Eli Zaretskii [this message]

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=83ilte0w28.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54032@debbugs.gnu.org \
    --cc=kaura.dev@sange.fi \
    /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).