From: Kim F. Storm Date: Thu, 13 Feb 2003 12:44:57 +0000 (+0000) Subject: (read_escape): Interpret \s as a SPACE character, except X-Git-Tag: ttn-vms-21-2-B4~11214 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37cd423857a5ca70550c59f932fdb7e2f1f3e420;p=emacs.git (read_escape): Interpret \s as a SPACE character, except for \s-X in a character constant which still is the super modifier. (read1): Signal an `invalid read syntax' error if a character constant is immediately followed by a digit or symbol character. --- diff --git a/src/ChangeLog b/src/ChangeLog index d849ecb49e3..bf03f943786 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2003-02-13 Kim F. Storm + * lread.c (read_escape): Interpret \s as a SPACE character, except + for \s-X in a character constant which still is the super modifier. + (read1): Signal an `invalid read syntax' error if a character + constant is immediately followed by a digit or symbol character. + * search.c (Fmatch_data): Doc fix. Explicitly state that match-data is undefined if last search failed. diff --git a/src/lread.c b/src/lread.c index e32f669ecf2..228a60075dc 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1697,9 +1697,13 @@ read_escape (readcharfun, stringp, byterep) return c | alt_modifier; case 's': + if (stringp) + return ' '; c = READCHAR; - if (c != '-') - error ("Invalid escape character syntax"); + if (c != '-') { + UNREAD (c); + return ' '; + } c = READCHAR; if (c == '\\') c = read_escape (readcharfun, 0, byterep); @@ -2247,6 +2251,7 @@ read1 (readcharfun, pch, first_in_list) case '?': { int discard; + int nextc; c = READCHAR; if (c < 0) @@ -2257,6 +2262,15 @@ read1 (readcharfun, pch, first_in_list) else if (BASE_LEADING_CODE_P (c)) c = read_multibyte (c, readcharfun); + nextc = READCHAR; + UNREAD (nextc); + if (nextc > 040 + && !(nextc == '?' + || nextc == '\"' || nextc == '\'' || nextc == ';' + || nextc == '(' || nextc == ')' + || nextc == '[' || nextc == ']' || nextc == '#')) + Fsignal (Qinvalid_read_syntax, Fcons (make_string ("?", 1), Qnil)); + return make_number (c); }