aboutsummaryrefslogtreecommitdiffstats
path: root/src/character.c
diff options
context:
space:
mode:
authorPaul Eggert2015-04-15 00:26:32 -0700
committerPaul Eggert2015-04-15 00:27:18 -0700
commita122a0276bddbda8ca84f9b94250a5a5f4e0582a (patch)
tree4d0368943f2d0c53504e1e5e4727adaafd602d7e /src/character.c
parent45d75c0b758cf152698e83e180dfc8eed5d355ba (diff)
downloademacs-a122a0276bddbda8ca84f9b94250a5a5f4e0582a.tar.gz
emacs-a122a0276bddbda8ca84f9b94250a5a5f4e0582a.zip
Make [:graph:] act like [:print:] sans space
In POSIX [[:print:]] is equivalent to [ [:graph:]], so change [:graph:] so that it matches everything that [:print:] does, except for space. * doc/lispref/searching.texi (Char Classes): * etc/NEWS: * lisp/emacs-lisp/rx.el (rx): Document [:graph:] to be [:print:] sans ' '. * src/character.c, src/character.h (graphicp): New function. * src/regex.c (ISGRAPH) [emacs]: Use it. (BIT_GRAPH): New macro. (BIT_PRINT): Increase to 0x200, to make room for BIT_GRAPH. (re_wctype_to_bit) [! WIDE_CHAR_SUPPORT]: Return BIT_GRAPH for RECC_GRAPH. (re_match_2_internal) [emacs]: Use ISGRAPH if BIT_GRAPH, and ISPRINT if BIT_PRINT.
Diffstat (limited to 'src/character.c')
-rw-r--r--src/character.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/character.c b/src/character.c
index b357dd5a334..ea98cf68e6c 100644
--- a/src/character.c
+++ b/src/character.c
@@ -1022,6 +1022,14 @@ decimalnump (int c)
1022 return gen_cat == UNICODE_CATEGORY_Nd; 1022 return gen_cat == UNICODE_CATEGORY_Nd;
1023} 1023}
1024 1024
1025/* Return 'true' if C is a graphic character as defined by its
1026 Unicode properties. */
1027bool
1028graphicp (int c)
1029{
1030 return c == ' ' || printablep (c);
1031}
1032
1025/* Return 'true' if C is a printable character as defined by its 1033/* Return 'true' if C is a printable character as defined by its
1026 Unicode properties. */ 1034 Unicode properties. */
1027bool 1035bool