GNU bug report logs - #52067
29.0.50; string-glyph-split halts on certain emoji strings

Previous Next

Package: emacs;

Reported by: PAVLOS MARAGAKIS <paul.maragakis <at> icloud.com>

Date: Tue, 23 Nov 2021 23:02:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 52067 <at> debbugs.gnu.org (full text, mbox):

From: Paul Maragakis <paul.maragakis <at> icloud.com>
To: 52067 <at> debbugs.gnu.org
Subject: Re: bug#52067: Acknowledgement (29.0.50; string-glyph-split halts on
 certain emoji strings)
Date: Tue, 23 Nov 2021 22:51:07 -0500
The logic in string-glyph-split expects the first two elements in the result
from find-composition-internal to give the start and end of a multibyte grapheme
and return nil when there is a regular character at position POS.  However, this 
isn't always the case.

Let's call x the argument POS in find-composition-internal, 
and "interval" the first two elements of the return value.

The following example works as expected, i.e. x of 0, or 1 returns the interval (0 2), 
and x of 2, or 3 returns (2 4).

(null
 (pp
  (mapcar '(lambda (x) (list x (find-composition-internal x nil "✈️✈️" nil))) '(0 1 2 3 4))))
((0
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (1
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (2
  (2 4
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (3
  (2 4
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (4 nil))
nil


In the following case, however, x of 2 returns interval (0 2).

(null
 (pp
  (mapcar '(lambda (x) (list x (find-composition-internal x nil "✈️🌍" nil))) '(0 1 2 3))))
((0
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (1
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (2
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (3 nil))
nil


Interestingly, in the following case, an x of 0, 1, 2, or 3 all return (0 2).

(null
 (pp
  (mapcar '(lambda (x) (list x (find-composition-internal x nil "✈️🌍🌍" nil))) '(0 1 2 3 4))))
((0
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (1
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (2
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (3
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (4 nil))
nil


And in the following case a POS of 3 returns (3 5)

(null
 (pp
  (mapcar '(lambda (x) (list x (find-composition-internal x nil "✈️🌍✈️" nil))) '(0 1 2 3 4 5))))
((0
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (1
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (2
  (0 2
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (3
  (3 5
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (4
  (3 5
     [[#<font-object "-*-Apple Color Emoji-medium-normal-normal-*-19-*-*-*-m-0-iso10646-1"> 9992 65039]
      296
      [0 1 9992 233 23 0 23 18 4 nil]]))
 (5 nil))
nil


> On Nov 23, 2021, at 6:02 PM, GNU bug Tracking System <help-debbugs <at> gnu.org> wrote:
> 
> Thank you for filing a new bug report with debbugs.gnu.org.
> 
> This is an automatically generated reply to let you know your message
> has been received.
> 
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
> 
> Your message has been sent to the package maintainer(s):
> bug-gnu-emacs <at> gnu.org
> 
> If you wish to submit further information on this problem, please
> send it to 52067 <at> debbugs.gnu.org.
> 
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.
> 
> -- 
> 52067: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52067
> GNU Bug Tracking System
> Contact help-debbugs <at> gnu.org with problems





This bug report was last modified 3 years and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.