diff options
Diffstat (limited to 'src/character.h')
-rw-r--r-- | src/character.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/character.h b/src/character.h index a94ec6d22dd..fc8a0dd74d2 100644 --- a/src/character.h +++ b/src/character.h @@ -588,9 +588,10 @@ sanitize_char_width (EMACS_INT width) /* Return the width of character C. The width is measured by how many columns C will occupy on the screen when displayed in the current - buffer. */ + buffer. The name CHARACTER_WIDTH avoids a collision with <limits.h> + CHAR_WIDTH when enabled; see ISO/IEC TS 18661-1:2014. */ -#define CHAR_WIDTH(c) \ +#define CHARACTER_WIDTH(c) \ (ASCII_CHAR_P (c) \ ? ASCII_CHAR_WIDTH (c) \ : sanitize_char_width (XINT (CHAR_TABLE_REF (Vchar_width_table, c)))) @@ -605,14 +606,13 @@ sanitize_char_width (EMACS_INT width) : (c) <= 0xE01EF ? (c) - 0xE0100 + 17 \ : 0) -/* If C is a high surrogate, return 1. If C is a low surrogate, - return 2. Otherwise, return 0. */ +/* Return true if C is a surrogate. */ -#define CHAR_SURROGATE_PAIR_P(c) \ - ((c) < 0xD800 ? 0 \ - : (c) <= 0xDBFF ? 1 \ - : (c) <= 0xDFFF ? 2 \ - : 0) +INLINE bool +char_surrogate_p (int c) +{ + return 0xD800 <= c && c <= 0xDFFF; +} /* Data type for Unicode general category. @@ -677,7 +677,7 @@ extern Lisp_Object Vchar_unify_table; extern Lisp_Object string_escape_byte8 (Lisp_Object); extern bool alphabeticp (int); -extern bool decimalnump (int); +extern bool alphanumericp (int); extern bool graphicp (int); extern bool printablep (int); |