diff options
| author | Richard M. Stallman | 2005-12-28 03:44:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-12-28 03:44:28 +0000 |
| commit | 721b7d9ee61e436d012527664fee8acc152f4715 (patch) | |
| tree | 7acd91d08bd92ec7c1a19e3ef46c842f062eb6b5 /src | |
| parent | 18e980c2ae616c850f2786bd889c26b0eab71ff3 (diff) | |
| download | emacs-721b7d9ee61e436d012527664fee8acc152f4715.tar.gz emacs-721b7d9ee61e436d012527664fee8acc152f4715.zip | |
(readevalloop): Set PT and ZV in the proper buffer, not the current one.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c index 5fb0a39ff03..c8aa55780c2 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1344,10 +1344,20 @@ readevalloop (readcharfun, stream, sourcename, evalfun, | |||
| 1344 | if (b != 0 && NILP (b->name)) | 1344 | if (b != 0 && NILP (b->name)) |
| 1345 | error ("Reading from killed buffer"); | 1345 | error ("Reading from killed buffer"); |
| 1346 | 1346 | ||
| 1347 | |||
| 1347 | if (!NILP (start)) | 1348 | if (!NILP (start)) |
| 1348 | { | 1349 | { |
| 1350 | /* Switch to the buffer we are reading from. */ | ||
| 1351 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | ||
| 1352 | set_buffer_internal (b); | ||
| 1353 | |||
| 1354 | /* Save point in it. */ | ||
| 1349 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 1355 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 1356 | /* Save ZV in it. */ | ||
| 1350 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); | 1357 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); |
| 1358 | /* Those get unbound after we read one expression. */ | ||
| 1359 | |||
| 1360 | /* Set point and ZV around stuff to be read. */ | ||
| 1351 | Fgoto_char (start); | 1361 | Fgoto_char (start); |
| 1352 | Fnarrow_to_region (make_number (BEGV), end); | 1362 | Fnarrow_to_region (make_number (BEGV), end); |
| 1353 | } | 1363 | } |