diff src/text.h @ 5863:15041705c196

Provide `char-code-limit', implement the GNU equivalent in terms of it. src/ChangeLog addition: 2015-03-15 Aidan Kehoe <kehoea@parhasard.net> * text.h: Make CHAR_CODE_LIMIT available as a #define. * text.h (valid_ichar_p): Use it. * text.c: Make a fixnum Vchar_code_limit available here. * text.c (non_ascii_valid_ichar_p): Use CHAR_CODE_LIMIT. * text.c (vars_of_text): Make `char-code-limit' available to Lisp. tests/ChangeLog addition: 2015-03-15 Aidan Kehoe <kehoea@parhasard.net> * automated/mule-tests.el (test-chars): Use char-code-limit explicitly here, instead of hardcoding the corresponding values. lisp/ChangeLog addition: 2015-03-16 Aidan Kehoe <kehoea@parhasard.net> * obsolete.el (max-char): Make this available for compatiblity with GNU, implement it in terms of char-code-limit.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 16 Mar 2015 00:09:46 +0000
parents b3824b7f5627
children
line wrap: on
line diff
--- a/src/text.h	Sun Mar 15 21:13:23 2015 +0000
+++ b/src/text.h	Mon Mar 16 00:09:46 2015 +0000
@@ -121,6 +121,8 @@
 #define rep_bytes_by_first_byte(fb) 1
 #define byte_ascii_p(byte) 1
 #define MAX_ICHAR_LEN 1
+/* Exclusive upper bound on character codes. */
+#define CHAR_CODE_LIMIT 0x100 
 
 #else /* MULE */
 
@@ -212,12 +214,12 @@
 
 #define ichar_ascii_p(c) (!ichar_multibyte_p (c))
 
-/* Maximum number of bytes per Emacs character when represented as text, in
- any format.
- */
-
+/* Maximum number of bytes per Ichar when represented as text. */
 #define MAX_ICHAR_LEN 4
 
+/* Exclusive upper bound on char codes. */
+#define CHAR_CODE_LIMIT 0x200000 
+
 #endif /* not MULE */
 
 #ifdef MULE
@@ -239,7 +241,7 @@
 
 /* This works when CH is negative, and correctly returns non-zero only when CH
    is in the range [0, 255], inclusive. */
-#define valid_ichar_p(ch) (! (ch & ~0xFF))
+#define valid_ichar_p(ch) (! (ch & ~(CHAR_CODE_LIMIT - 1)))
 
 #endif /* not MULE */