comparison src/lread.c @ 70595:136d07d2859f

(readevalloop): Abort if START non-nil for non-buffer input.
author Richard M. Stallman <rms@gnu.org>
date Fri, 12 May 2006 02:08:16 +0000
parents 7de818fd5125
children b34d05d3a567 b6689e223e2f a5812696f7bf
comparison
equal deleted inserted replaced
70594:590ca68c1970 70595:136d07d2859f
1338 } 1338 }
1339 1339
1340 /* UNIBYTE specifies how to set load_convert_to_unibyte 1340 /* UNIBYTE specifies how to set load_convert_to_unibyte
1341 for this invocation. 1341 for this invocation.
1342 READFUN, if non-nil, is used instead of `read'. 1342 READFUN, if non-nil, is used instead of `read'.
1343 START, END is region in current buffer (from eval-region). */ 1343
1344 START, END specify region to read in current buffer (from eval-region).
1345 If the input is not from a buffer, they must be nil. */
1344 1346
1345 static void 1347 static void
1346 readevalloop (readcharfun, stream, sourcename, evalfun, 1348 readevalloop (readcharfun, stream, sourcename, evalfun,
1347 printflag, unibyte, readfun, start, end) 1349 printflag, unibyte, readfun, start, end)
1348 Lisp_Object readcharfun; 1350 Lisp_Object readcharfun;
1373 1375
1374 if (BUFFERP (readcharfun)) 1376 if (BUFFERP (readcharfun))
1375 b = XBUFFER (readcharfun); 1377 b = XBUFFER (readcharfun);
1376 else if (MARKERP (readcharfun)) 1378 else if (MARKERP (readcharfun))
1377 b = XMARKER (readcharfun)->buffer; 1379 b = XMARKER (readcharfun)->buffer;
1380
1381 /* We assume START is nil when input is not from a buffer. */
1382 if (! NILP (start) && !b)
1383 abort ();
1378 1384
1379 specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */ 1385 specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */
1380 specbind (Qcurrent_load_list, Qnil); 1386 specbind (Qcurrent_load_list, Qnil);
1381 record_unwind_protect (readevalloop_1, load_convert_to_unibyte ? Qt : Qnil); 1387 record_unwind_protect (readevalloop_1, load_convert_to_unibyte ? Qt : Qnil);
1382 load_convert_to_unibyte = !NILP (unibyte); 1388 load_convert_to_unibyte = !NILP (unibyte);