emacs-devel
[Top][All Lists]
Advanced

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

Re: Entering emojis


From: Eli Zaretskii
Subject: Re: Entering emojis
Date: Sat, 30 Oct 2021 09:19:07 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Stefan Kangas <stefankangas@gmail.com>,
>   emacs-devel@gnu.org
> Date: Sat, 30 Oct 2021 00:16:39 +0200
> 
> A more ticklish question is what we should do with out string primitives
> (if anything).  For instance:
> 
> (string-limit "Hello, πŸ‘¨πŸ½β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸΎ" 8)
> => "Hello, πŸ‘¨"
> 
> and
> 
> (truncate-string-to-width "πŸ‘¨πŸ½β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸΎ" 2 nil t)
> => "πŸ‘¨"

Nothing, they should "just work", barring bugs.

What does string-width return for this string on your system?

> which is...  uhm...  In a way, this grapheme cluster thing is slightly
> like it was during the shift to utf-8, when not all string primitives
> worked on characters, but bytes instead.  Less dramatic, of course, but.
> 
> I think we'll be seeing many amusing display glitches in this area.  πŸ₯²

We shouldn't, because string-width already supports composed text.
There's always one more bug, of course, but there are no design
problems here, AFAICT.  Emoji sequences are just one special case of
character composition, that's all.  So this is nothing like a switch
to multibyte characters, at least not in theory.



reply via email to

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