aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-06-07 12:31:26 +0000
committerGerd Moellmann2000-06-07 12:31:26 +0000
commitf38952fe7bd43bbe4013d9a1d99d9bfc7dd7d742 (patch)
tree7279f500decc692291a5efb15e6e05dd3ec8c46c
parentb7617575cd3074eae8bf7fe57c86e957d7c29690 (diff)
downloademacs-f38952fe7bd43bbe4013d9a1d99d9bfc7dd7d742.tar.gz
emacs-f38952fe7bd43bbe4013d9a1d99d9bfc7dd7d742.zip
(readevalloop): If READCHARFUN sets point to ZV, arrange
to stop reading, even if the form read sets point to a different value when evaluated.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/lread.c21
2 files changed, 26 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fb734387aa4..2a5875dac96 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12000-06-07 Gerd Moellmann <gerd@gnu.org> 12000-06-07 Gerd Moellmann <gerd@gnu.org>
2 2
3 * window.c (displayed_window_lines): New function.
4 (Fmove_to_window_line): Use displayed_window_lines to determine
5 the number of lines to move, instead of using the window's height.
6
7 * lread.c (readevalloop): If READCHARFUN sets point to ZV, arrange
8 to stop reading, even if the form read sets point to a different
9 value when evaluated.
10
3 * xdisp.c (display_line): Fix code deciding in which line to 11 * xdisp.c (display_line): Fix code deciding in which line to
4 put the cursor. 12 put the cursor.
5 13
diff --git a/src/lread.c b/src/lread.c
index 1e33df4a87a..3a1bc00c03f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1136,6 +1136,7 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
1136 int count = specpdl_ptr - specpdl; 1136 int count = specpdl_ptr - specpdl;
1137 struct gcpro gcpro1; 1137 struct gcpro gcpro1;
1138 struct buffer *b = 0; 1138 struct buffer *b = 0;
1139 int continue_reading_p;
1139 1140
1140 if (BUFFERP (readcharfun)) 1141 if (BUFFERP (readcharfun))
1141 b = XBUFFER (readcharfun); 1142 b = XBUFFER (readcharfun);
@@ -1153,7 +1154,8 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
1153 1154
1154 LOADHIST_ATTACH (sourcename); 1155 LOADHIST_ATTACH (sourcename);
1155 1156
1156 while (1) 1157 continue_reading_p = 1;
1158 while (continue_reading_p)
1157 { 1159 {
1158 if (b != 0 && NILP (b->name)) 1160 if (b != 0 && NILP (b->name))
1159 error ("Reading from killed buffer"); 1161 error ("Reading from killed buffer");
@@ -1182,8 +1184,20 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
1182 { 1184 {
1183 UNREAD (c); 1185 UNREAD (c);
1184 read_objects = Qnil; 1186 read_objects = Qnil;
1185 if (! NILP (readfun)) 1187 if (!NILP (readfun))
1186 val = call1 (readfun, readcharfun); 1188 {
1189 val = call1 (readfun, readcharfun);
1190
1191 /* If READCHARFUN has set point to ZV, we should
1192 stop reading, even if the form read sets point
1193 to a different value when evaluated. */
1194 if (BUFFERP (readcharfun))
1195 {
1196 struct buffer *b = XBUFFER (readcharfun);
1197 if (BUF_PT (b) == BUF_ZV (b))
1198 continue_reading_p = 0;
1199 }
1200 }
1187 else if (! NILP (Vload_read_function)) 1201 else if (! NILP (Vload_read_function))
1188 val = call1 (Vload_read_function, readcharfun); 1202 val = call1 (Vload_read_function, readcharfun);
1189 else 1203 else
@@ -1191,6 +1205,7 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag, unibyte, read
1191 } 1205 }
1192 1206
1193 val = (*evalfun) (val); 1207 val = (*evalfun) (val);
1208
1194 if (printflag) 1209 if (printflag)
1195 { 1210 {
1196 Vvalues = Fcons (val, Vvalues); 1211 Vvalues = Fcons (val, Vvalues);