diff options
| author | Kim F. Storm | 2003-02-13 12:44:57 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-02-13 12:44:57 +0000 |
| commit | 37cd423857a5ca70550c59f932fdb7e2f1f3e420 (patch) | |
| tree | 83828c7a13b8bddadda6da88764a8676f0851143 /src | |
| parent | c794a94d9af00b4bf8461d0f1e4f6c9282767c5e (diff) | |
| download | emacs-37cd423857a5ca70550c59f932fdb7e2f1f3e420.tar.gz emacs-37cd423857a5ca70550c59f932fdb7e2f1f3e420.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lread.c | 18 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d849ecb49e3..bf03f943786 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2003-02-13 Kim F. Storm <storm@cua.dk> | 1 | 2003-02-13 Kim F. Storm <storm@cua.dk> |
| 2 | 2 | ||
| 3 | * lread.c (read_escape): Interpret \s as a SPACE character, except | ||
| 4 | for \s-X in a character constant which still is the super modifier. | ||
| 5 | (read1): Signal an `invalid read syntax' error if a character | ||
| 6 | constant is immediately followed by a digit or symbol character. | ||
| 7 | |||
| 3 | * search.c (Fmatch_data): Doc fix. Explicitly state that | 8 | * search.c (Fmatch_data): Doc fix. Explicitly state that |
| 4 | match-data is undefined if last search failed. | 9 | match-data is undefined if last search failed. |
| 5 | 10 | ||
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) | |||
| 1697 | return c | alt_modifier; | 1697 | return c | alt_modifier; |
| 1698 | 1698 | ||
| 1699 | case 's': | 1699 | case 's': |
| 1700 | if (stringp) | ||
| 1701 | return ' '; | ||
| 1700 | c = READCHAR; | 1702 | c = READCHAR; |
| 1701 | if (c != '-') | 1703 | if (c != '-') { |
| 1702 | error ("Invalid escape character syntax"); | 1704 | UNREAD (c); |
| 1705 | return ' '; | ||
| 1706 | } | ||
| 1703 | c = READCHAR; | 1707 | c = READCHAR; |
| 1704 | if (c == '\\') | 1708 | if (c == '\\') |
| 1705 | c = read_escape (readcharfun, 0, byterep); | 1709 | c = read_escape (readcharfun, 0, byterep); |
| @@ -2247,6 +2251,7 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2247 | case '?': | 2251 | case '?': |
| 2248 | { | 2252 | { |
| 2249 | int discard; | 2253 | int discard; |
| 2254 | int nextc; | ||
| 2250 | 2255 | ||
| 2251 | c = READCHAR; | 2256 | c = READCHAR; |
| 2252 | if (c < 0) | 2257 | if (c < 0) |
| @@ -2257,6 +2262,15 @@ read1 (readcharfun, pch, first_in_list) | |||
| 2257 | else if (BASE_LEADING_CODE_P (c)) | 2262 | else if (BASE_LEADING_CODE_P (c)) |
| 2258 | c = read_multibyte (c, readcharfun); | 2263 | c = read_multibyte (c, readcharfun); |
| 2259 | 2264 | ||
| 2265 | nextc = READCHAR; | ||
| 2266 | UNREAD (nextc); | ||
| 2267 | if (nextc > 040 | ||
| 2268 | && !(nextc == '?' | ||
| 2269 | || nextc == '\"' || nextc == '\'' || nextc == ';' | ||
| 2270 | || nextc == '(' || nextc == ')' | ||
| 2271 | || nextc == '[' || nextc == ']' || nextc == '#')) | ||
| 2272 | Fsignal (Qinvalid_read_syntax, Fcons (make_string ("?", 1), Qnil)); | ||
| 2273 | |||
| 2260 | return make_number (c); | 2274 | return make_number (c); |
| 2261 | } | 2275 | } |
| 2262 | 2276 | ||