From: tomo Date: Tue, 15 Jun 1999 02:00:37 +0000 (+0000) Subject: (read_escape): Add new reader `u'. X-Git-Tag: r21-2-15-buf-utf8-1~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f34f50bc6051e079c991a0012ab346e47d4eabbc;p=chise%2Fxemacs-chise.git.1 (read_escape): Add new reader `u'. --- 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