From f34f50bc6051e079c991a0012ab346e47d4eabbc Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 15 Jun 1999 02:00:37 +0000 Subject: [PATCH] (read_escape): Add new reader `u'. --- src/lread.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lread.c b/src/lread.c index 481f664..4bb1bcd 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1821,6 +1821,25 @@ read_escape (Lisp_Object readcharfun) } return i; } + case 'u': + { + REGISTER Emchar i = 0; + REGISTER int count = 0; + while (++count <= 6) + { + c = readchar (readcharfun); + /* Remember, can't use isdigit(), isalpha() etc. on Emchars */ + if (c >= '0' && c <= '9') i = (i << 4) + (c - '0'); + else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; + else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10; + else + { + unreadchar (readcharfun, c); + break; + } + } + return i; + } #ifdef MULE /* #### need some way of reading an extended character with -- 1.7.10.4