aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/character.c17
-rw-r--r--src/character.h2
-rw-r--r--src/regex.c2
3 files changed, 15 insertions, 6 deletions
diff --git a/src/character.c b/src/character.c
index 9f60aa718d5..b19e41d660a 100644
--- a/src/character.c
+++ b/src/character.c
@@ -983,17 +983,26 @@ alphabeticp (int c)
983 || gen_cat == UNICODE_CATEGORY_Nl); 983 || gen_cat == UNICODE_CATEGORY_Nl);
984} 984}
985 985
986/* Return true if C is a decimal-number character. */ 986/* Return true if C is a alphabetic or decimal-number character. */
987bool 987bool
988decimalnump (int c) 988alphanumericp (int c)
989{ 989{
990 Lisp_Object category = CHAR_TABLE_REF (Vunicode_category_table, c); 990 Lisp_Object category = CHAR_TABLE_REF (Vunicode_category_table, c);
991 if (! INTEGERP (category)) 991 if (! INTEGERP (category))
992 return false; 992 return false;
993 EMACS_INT gen_cat = XINT (category); 993 EMACS_INT gen_cat = XINT (category);
994 994
995 /* See UTS #18. */ 995 /* See UTS #18. Same comment as for alphabeticp applies. FIXME. */
996 return gen_cat == UNICODE_CATEGORY_Nd; 996 return (gen_cat == UNICODE_CATEGORY_Lu
997 || gen_cat == UNICODE_CATEGORY_Ll
998 || gen_cat == UNICODE_CATEGORY_Lt
999 || gen_cat == UNICODE_CATEGORY_Lm
1000 || gen_cat == UNICODE_CATEGORY_Lo
1001 || gen_cat == UNICODE_CATEGORY_Mn
1002 || gen_cat == UNICODE_CATEGORY_Mc
1003 || gen_cat == UNICODE_CATEGORY_Me
1004 || gen_cat == UNICODE_CATEGORY_Nl
1005 || gen_cat == UNICODE_CATEGORY_Nd);
997} 1006}
998 1007
999/* Return true if C is a graphic character. */ 1008/* Return true if C is a graphic character. */
diff --git a/src/character.h b/src/character.h
index 7f01bc6a31e..2cb76b0f2d5 100644
--- a/src/character.h
+++ b/src/character.h
@@ -676,7 +676,7 @@ extern Lisp_Object Vchar_unify_table;
676extern Lisp_Object string_escape_byte8 (Lisp_Object); 676extern Lisp_Object string_escape_byte8 (Lisp_Object);
677 677
678extern bool alphabeticp (int); 678extern bool alphabeticp (int);
679extern bool decimalnump (int); 679extern bool alphanumericp (int);
680extern bool graphicp (int); 680extern bool graphicp (int);
681extern bool printablep (int); 681extern bool printablep (int);
682 682
diff --git a/src/regex.c b/src/regex.c
index c808398cda6..5f51b43e6c8 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -324,7 +324,7 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
324 ? (((c) >= 'a' && (c) <= 'z') \ 324 ? (((c) >= 'a' && (c) <= 'z') \
325 || ((c) >= 'A' && (c) <= 'Z') \ 325 || ((c) >= 'A' && (c) <= 'Z') \
326 || ((c) >= '0' && (c) <= '9')) \ 326 || ((c) >= '0' && (c) <= '9')) \
327 : (alphabeticp (c) || decimalnump (c))) 327 : alphanumericp (c))
328 328
329# define ISALPHA(c) (IS_REAL_ASCII (c) \ 329# define ISALPHA(c) (IS_REAL_ASCII (c) \
330 ? (((c) >= 'a' && (c) <= 'z') \ 330 ? (((c) >= 'a' && (c) <= 'z') \