comparison src/lread.c @ 278:90d73dddcdc4 r21-0b37

Import from CVS: tag r21-0b37
author cvs
date Mon, 13 Aug 2007 10:31:29 +0200
parents c5d627a313b1
children 7df0dd720c89
comparison
equal deleted inserted replaced
277:cfdf3ff11843 278:90d73dddcdc4
25 /* This file has been Mule-ized. */ 25 /* This file has been Mule-ized. */
26 26
27 #include <config.h> 27 #include <config.h>
28 #include "lisp.h" 28 #include "lisp.h"
29 29
30 #ifndef standalone
31 #include "buffer.h" 30 #include "buffer.h"
32 #include "bytecode.h" 31 #include "bytecode.h"
33 #include "commands.h" 32 #include "commands.h"
34 #include "insdel.h" 33 #include "insdel.h"
35 #include "lstream.h" 34 #include "lstream.h"
36 #include "opaque.h" 35 #include "opaque.h"
37 #include <paths.h> 36 #include <paths.h>
38 #endif
39 #ifdef FILE_CODING 37 #ifdef FILE_CODING
40 #include "file-coding.h" 38 #include "file-coding.h"
41 #endif 39 #endif
42 40
43 #include "sysfile.h" 41 #include "sysfile.h"
338 336
339 static Lisp_Object read_list (Lisp_Object readcharfun, 337 static Lisp_Object read_list (Lisp_Object readcharfun,
340 Emchar terminator, 338 Emchar terminator,
341 int allow_dotted_lists, 339 int allow_dotted_lists,
342 int check_for_doc_references); 340 int check_for_doc_references);
343
344 /* get a character from the tty */
345
346 #ifdef standalone /* This primitive is normally not defined */
347
348 #define kludge DEFUN /* to keep this away from make-docfile... */
349 kludge ("read-char", Fread_char, Sread_char, 0, 0, 0, "") ()
350 {
351 return getchar ();
352 }
353 #undef kludge
354 #endif /* standalone */
355
356
357 341
358 static void readevalloop (Lisp_Object readcharfun, 342 static void readevalloop (Lisp_Object readcharfun,
359 Lisp_Object sourcefile, 343 Lisp_Object sourcefile,
360 Lisp_Object (*evalfun) (Lisp_Object), 344 Lisp_Object (*evalfun) (Lisp_Object),
361 int printflag); 345 int printflag);
1371 UNGCPRO; 1355 UNGCPRO;
1372 1356
1373 unbind_to (speccount, Qnil); 1357 unbind_to (speccount, Qnil);
1374 } 1358 }
1375 1359
1376 #ifndef standalone
1377
1378 DEFUN ("eval-buffer", Feval_buffer, 0, 2, "bBuffer: ", /* 1360 DEFUN ("eval-buffer", Feval_buffer, 0, 2, "bBuffer: ", /*
1379 Execute BUFFER as Lisp code. 1361 Execute BUFFER as Lisp code.
1380 Programs can pass two arguments, BUFFER and PRINTFLAG. 1362 Programs can pass two arguments, BUFFER and PRINTFLAG.
1381 BUFFER is the buffer to evaluate (nil means use current buffer). 1363 BUFFER is the buffer to evaluate (nil means use current buffer).
1382 PRINTFLAG controls printing of output: 1364 PRINTFLAG controls printing of output:
1465 readevalloop (cbuf, XBUFFER (cbuf)->filename, Feval, 1447 readevalloop (cbuf, XBUFFER (cbuf)->filename, Feval,
1466 !NILP (printflag)); 1448 !NILP (printflag));
1467 1449
1468 return unbind_to (speccount, Qnil); 1450 return unbind_to (speccount, Qnil);
1469 } 1451 }
1470
1471 #endif /* standalone */
1472 1452
1473 DEFUN ("read", Fread, 0, 1, 0, /* 1453 DEFUN ("read", Fread, 0, 1, 0, /*
1474 Read one Lisp expression as text from STREAM, return as Lisp object. 1454 Read one Lisp expression as text from STREAM, return as Lisp object.
1475 If STREAM is nil, use the value of `standard-input' (which see). 1455 If STREAM is nil, use the value of `standard-input' (which see).
1476 STREAM or the value of `standard-input' may be: 1456 STREAM or the value of `standard-input' may be:
1491 read_objects = Qnil; 1471 read_objects = Qnil;
1492 1472
1493 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK 1473 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
1494 Vcurrent_compiled_function_annotation = Qnil; 1474 Vcurrent_compiled_function_annotation = Qnil;
1495 #endif 1475 #endif
1496 #ifndef standalone
1497 if (EQ (stream, Qread_char)) 1476 if (EQ (stream, Qread_char))
1498 { 1477 {
1499 Lisp_Object val = call1 (Qread_from_minibuffer, 1478 Lisp_Object val = call1 (Qread_from_minibuffer,
1500 build_translated_string ("Lisp expression: ")); 1479 build_translated_string ("Lisp expression: "));
1501 return Fcar (Fread_from_string (val, Qnil, Qnil)); 1480 return Fcar (Fread_from_string (val, Qnil, Qnil));
1502 } 1481 }
1503 #endif
1504 1482
1505 if (STRINGP (stream)) 1483 if (STRINGP (stream))
1506 return Fcar (Fread_from_string (stream, Qnil, Qnil)); 1484 return Fcar (Fread_from_string (stream, Qnil, Qnil));
1507 1485
1508 return read0 (stream); 1486 return read0 (stream);
3029 DEFSUBR (Fload_internal); 3007 DEFSUBR (Fload_internal);
3030 DEFSUBR (Flocate_file); 3008 DEFSUBR (Flocate_file);
3031 DEFSUBR (Flocate_file_clear_hashing); 3009 DEFSUBR (Flocate_file_clear_hashing);
3032 DEFSUBR (Feval_buffer); 3010 DEFSUBR (Feval_buffer);
3033 DEFSUBR (Feval_region); 3011 DEFSUBR (Feval_region);
3034 #ifdef standalone
3035 DEFSUBR (Fread_char);
3036 #endif
3037 3012
3038 defsymbol (&Qstandard_input, "standard-input"); 3013 defsymbol (&Qstandard_input, "standard-input");
3039 defsymbol (&Qread_char, "read-char"); 3014 defsymbol (&Qread_char, "read-char");
3040 defsymbol (&Qcurrent_load_list, "current-load-list"); 3015 defsymbol (&Qcurrent_load_list, "current-load-list");
3041 defsymbol (&Qload, "load"); 3016 defsymbol (&Qload, "load");