[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: describe-char on emoji sequences

From: Eli Zaretskii
Subject: Re: describe-char on emoji sequences
Date: Wed, 27 Oct 2021 16:57:46 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 26 Oct 2021 21:42:42 +0200
> Eli Zaretskii <eliz@gnu.org> writes:
> >> 💂🏾‍♂️
> [...]
> > Yes, it is correct: it reports on the character at a certain buffer
> > position (you elided that part).
> No, the glyph in question is the one at the start of the email: 💂🏾‍♂️.

The command is describe-char, and it reports on the character at

  (describe-char POS &optional BUFFER)

  Describe position POS (interactively, point) and the char after POS.

> > If you want a command that could show how to input a sequence of
> > characters that were composed, it should be a different command, and
> > the way to type such a sequence cannot be automatically generated,
> > because how would Emacs know that there's a particular command that
> > would produce such a sequence?
> It's just a sequence of Unicode code points, surely?  (And the help
> buffer lists them, but not in the format needed to enter them.)

How can Emacs know that there is a special command that can be used to
insert this entire sequence of codepoints in one go?

> >> And the name is "man guard: medium-light skin tone", which we should
> >> probably output somewhere.
> >
> > That's not a character, while this command describes a character.
> Well...  it's a glyph, and the command describes the glyph perfectly
> (i.e., all the elements that are part of it), but it doesn't output the
> resulting name for the glyph.

Because it doesn't necessarily have a name.  This is a general-purpose
command, it is capable of describing any result of any character
composition, including those which yield more than one glyph and
glyphs that have no name.  (Technically, the correct terminology is
"grapheme cluster", not "glyph".)

We could, of course, program describe-char to give special treatment
to glyphs produced from the Emoji sequences, but that has to be coded
explicitly and specially for Emoji, because I don't see how you can do
that for an arbitrary composition.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]