diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c index e69e3f86943..144f991223f 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -268,9 +268,41 @@ unreadchar (readcharfun, c) | |||
| 268 | since readchar didn't advance it when we read it. */ | 268 | since readchar didn't advance it when we read it. */ |
| 269 | ; | 269 | ; |
| 270 | else if (BUFFERP (readcharfun)) | 270 | else if (BUFFERP (readcharfun)) |
| 271 | readchar_backlog++; | 271 | { |
| 272 | if (!SINGLE_BYTE_CHAR_P (c)) | ||
| 273 | readchar_backlog++; | ||
| 274 | else | ||
| 275 | { | ||
| 276 | struct buffer *b = XBUFFER (readcharfun); | ||
| 277 | int bytepos = BUF_PT_BYTE (b); | ||
| 278 | |||
| 279 | BUF_PT (b)--; | ||
| 280 | if (! NILP (b->enable_multibyte_characters)) | ||
| 281 | BUF_DEC_POS (b, bytepos); | ||
| 282 | else | ||
| 283 | bytepos--; | ||
| 284 | |||
| 285 | BUF_PT_BYTE (b) = bytepos; | ||
| 286 | } | ||
| 287 | } | ||
| 272 | else if (MARKERP (readcharfun)) | 288 | else if (MARKERP (readcharfun)) |
| 273 | readchar_backlog++; | 289 | { |
| 290 | if (!SINGLE_BYTE_CHAR_P (c)) | ||
| 291 | readchar_backlog++; | ||
| 292 | else | ||
| 293 | { | ||
| 294 | struct buffer *b = XMARKER (readcharfun)->buffer; | ||
| 295 | int bytepos = XMARKER (readcharfun)->bytepos; | ||
| 296 | |||
| 297 | XMARKER (readcharfun)->charpos--; | ||
| 298 | if (! NILP (b->enable_multibyte_characters)) | ||
| 299 | BUF_DEC_POS (b, bytepos); | ||
| 300 | else | ||
| 301 | bytepos--; | ||
| 302 | |||
| 303 | XMARKER (readcharfun)->bytepos = bytepos; | ||
| 304 | } | ||
| 305 | } | ||
| 274 | else if (STRINGP (readcharfun)) | 306 | else if (STRINGP (readcharfun)) |
| 275 | read_from_string_index--; | 307 | read_from_string_index--; |
| 276 | else if (EQ (readcharfun, Qget_file_char)) | 308 | else if (EQ (readcharfun, Qget_file_char)) |