X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/358a8b34ac954ca147de9ececa4a51a21e60c97e..829733104db073f8abd67765eae162e7360281fa:/src/character.h diff --git a/src/character.h b/src/character.h index 5043880cb4..bc3e155784 100644 --- a/src/character.h +++ b/src/character.h @@ -9,8 +9,8 @@ This file is part of GNU Emacs. GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,6 +24,7 @@ along with GNU Emacs. If not, see . */ #define EMACS_CHARACTER_H #include +#include "lisp.h" INLINE_HEADER_BEGIN @@ -59,6 +60,30 @@ INLINE_HEADER_BEGIN /* Maximum leading code of multibyte characters. */ #define MAX_MULTIBYTE_LEADING_CODE 0xF8 +/* Unicode character values. */ +enum +{ + NO_BREAK_SPACE = 0x00A0, + SOFT_HYPHEN = 0x00AD, + ZERO_WIDTH_NON_JOINER = 0x200C, + ZERO_WIDTH_JOINER = 0x200D, + HYPHEN = 0x2010, + NON_BREAKING_HYPHEN = 0x2011, + LEFT_SINGLE_QUOTATION_MARK = 0x2018, + RIGHT_SINGLE_QUOTATION_MARK = 0x2019, + PARAGRAPH_SEPARATOR = 0x2029, + LEFT_POINTING_ANGLE_BRACKET = 0x2329, + RIGHT_POINTING_ANGLE_BRACKET = 0x232A, + LEFT_ANGLE_BRACKET = 0x3008, + RIGHT_ANGLE_BRACKET = 0x3009, + OBJECT_REPLACEMENT_CHARACTER = 0xFFFC, +}; + +/* UTF-8 encodings. Use \x escapes, so they are portable to pre-C11 + compilers and can be concatenated with ordinary string literals. */ +#define uLSQM "\xE2\x80\x98" /* U+2018 LEFT SINGLE QUOTATION MARK */ +#define uRSQM "\xE2\x80\x99" /* U+2019 RIGHT SINGLE QUOTATION MARK */ + /* Nonzero iff C is a character that corresponds to a raw 8-bit byte. */ #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) @@ -110,14 +135,12 @@ INLINE_HEADER_BEGIN do { \ Lisp_Object tmp = XCAR (x); \ CHECK_CHARACTER (tmp); \ - XSETCAR ((x), tmp); \ } while (false) #define CHECK_CHARACTER_CDR(x) \ do { \ Lisp_Object tmp = XCDR (x); \ CHECK_CHARACTER (tmp); \ - XSETCDR ((x), tmp); \ } while (false) /* Nonzero iff C is a character of code less than 0x100. */ @@ -660,6 +683,11 @@ extern ptrdiff_t lisp_string_width (Lisp_Object, ptrdiff_t, extern Lisp_Object Vchar_unify_table; extern Lisp_Object string_escape_byte8 (Lisp_Object); +extern bool alphabeticp (int); +extern bool decimalnump (int); +extern bool graphicp (int); +extern bool printablep (int); + /* Return a translation table of id number ID. */ #define GET_TRANSLATION_TABLE(id) \ (XCDR (XVECTOR (Vtranslation_table_vector)->contents[(id)]))