changeset 67871:998f4ca6948d

(readevalloop): Set PT and ZV in the proper buffer, not the current one.
author Richard M. Stallman <rms@gnu.org>
date Wed, 28 Dec 2005 03:44:28 +0000
parents 60b2bb5ad00f
children a03cb96b7c8e
files src/lread.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Wed Dec 28 03:19:29 2005 +0000
+++ b/src/lread.c	Wed Dec 28 03:44:28 2005 +0000
@@ -1344,10 +1344,20 @@
       if (b != 0 && NILP (b->name))
 	error ("Reading from killed buffer");
 
+
       if (!NILP (start))
 	{
+	  /* Switch to the buffer we are reading from.  */
 	  record_unwind_protect (save_excursion_restore, save_excursion_save ());
+	  set_buffer_internal (b);
+
+	  /* Save point in it.  */
+	  record_unwind_protect (save_excursion_restore, save_excursion_save ());
+	  /* Save ZV in it.  */
 	  record_unwind_protect (save_restriction_restore, save_restriction_save ());
+	  /* Those get unbound after we read one expression.  */
+
+	  /* Set point and ZV around stuff to be read.  */
 	  Fgoto_char (start);
 	  Fnarrow_to_region (make_number (BEGV), end);
 	}