bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#51012: 29.0.50; Problems with emojis and vertical-motion


From: Robert Pluim
Subject: bug#51012: 29.0.50; Problems with emojis and vertical-motion
Date: Mon, 04 Oct 2021 18:43:53 +0200

>>>>> On Mon, 04 Oct 2021 17:02:58 +0200, Lars Ingebrigtsen <larsi@gnus.org> 
>>>>> said:

    Lars> The following signals an error:

    Lars> (with-temp-buffer
    Lars>   (insert "🏳️‍🌈")
    Lars>   (vertical-motion 1))

    Lars> Args out of range: 0

    Lars> In some circumstances (when edebug is in action or it's running from 
an
    Lars> async callback), it'll freeze Emacs altogether, so it's not totally 
safe
    Lars> to eval.

    Lars> I'm assuming it has something to do with the new emoji stuff, but I
    Lars> haven't tried to debug.

Gaah. What are the three most important problems in computer science
today?

1. Dependencies in code, especially when moving it
2. Off by one errors

This fixes it for me:

diff --git a/src/font.c b/src/font.c
index 82a1dffc01..83f0f8296a 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3918,7 +3918,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t 
*limit,
            val = XCAR (val);
          else if (VECTORP (val))
            val = AREF (val, 0);
-         font_object = font_for_char (face, XFIXNAT (val), pos - 1, string);
+         font_object = font_for_char (face, XFIXNAT (val), pos, string);
        }
     }
 





reply via email to

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