]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix cursor motion around some Emoji sequences
authorEli Zaretskii <eliz@gnu.org>
Sat, 25 Sep 2021 09:18:27 +0000 (12:18 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 25 Sep 2021 09:18:27 +0000 (12:18 +0300)
* src/character.h: Add TAG_SPACE and CANCEL_TAG to known Unicode
characters values.
* src/composite.c (char_composable_p): Recognize TAG characters
relevant to Emoji as composable regardless of their General
Category.  (Bug#39799)

src/character.h
src/composite.c

index 1a745484daaee9e4934b7dc8b95f4f9e201216dd..6ee6bcab20590dc120af84424ba3de7be9f5d82a 100644 (file)
@@ -82,6 +82,8 @@ enum
   LEFT_ANGLE_BRACKET = 0x3008,
   RIGHT_ANGLE_BRACKET = 0x3009,
   OBJECT_REPLACEMENT_CHARACTER = 0xFFFC,
+  TAG_SPACE = 0xE0020,
+  CANCEL_TAG = 0xE007F,
 };
 
 extern int char_string (unsigned, unsigned char *);
index e97f8e2b4cdc3d65c2944e33e669fc2fa9b7e884..c37b1fd4b95061d69d7895f51d5ec49e51e4cd2d 100644 (file)
@@ -953,6 +953,9 @@ char_composable_p (int c)
   Lisp_Object val;
   return (c >= ' '
          && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER
+             /* Per Unicode TR51, these tag characters can be part of
+                Emoji sequences.  */
+             || (TAG_SPACE <= c && c <= CANCEL_TAG)
              /* unicode-category-table may not be available during
                 dumping.  */
              || (CHAR_TABLE_P (Vunicode_category_table)