aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-09-04 03:48:17 +0000
committerKaroly Lorentey2005-09-04 03:48:17 +0000
commitfbf349734468d48b421c3d03074bb66dfcf3115b (patch)
tree0a7d1ee844b6c591a5a499d23e35931945106e5a /src/lread.c
parentf0caabd962b662cccbea472995d86af718cc8d0b (diff)
parent4b5fa40e1f1ba3cafde672863a0331311d1c2695 (diff)
downloademacs-fbf349734468d48b421c3d03074bb66dfcf3115b.tar.gz
emacs-fbf349734468d48b421c3d03074bb66dfcf3115b.zip
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied: * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0 tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1 Add CVS metadata files. * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2 Update from CVS. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/lread.c b/src/lread.c
index f159e98d4e9..94fb5ddb155 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,6 +1,7 @@
1/* Lisp parsing and input streams. 1/* Lisp parsing and input streams.
2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, 1998, 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995,
3 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -86,6 +87,7 @@ Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist
86Lisp_Object Qascii_character, Qload, Qload_file_name; 87Lisp_Object Qascii_character, Qload, Qload_file_name;
87Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 88Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
88Lisp_Object Qinhibit_file_name_operation; 89Lisp_Object Qinhibit_file_name_operation;
90Lisp_Object Qeval_buffer_list, Veval_buffer_list;
89 91
90extern Lisp_Object Qevent_symbol_element_mask; 92extern Lisp_Object Qevent_symbol_element_mask;
91extern Lisp_Object Qfile_exists_p; 93extern Lisp_Object Qfile_exists_p;
@@ -674,7 +676,6 @@ Return t if file exists. */)
674{ 676{
675 register FILE *stream; 677 register FILE *stream;
676 register int fd = -1; 678 register int fd = -1;
677 register Lisp_Object lispstream;
678 int count = SPECPDL_INDEX (); 679 int count = SPECPDL_INDEX ();
679 Lisp_Object temp; 680 Lisp_Object temp;
680 struct gcpro gcpro1; 681 struct gcpro gcpro1;
@@ -904,10 +905,7 @@ Return t if file exists. */)
904 } 905 }
905 906
906 GCPRO1 (file); 907 GCPRO1 (file);
907 lispstream = Fcons (Qnil, Qnil); 908 record_unwind_protect (load_unwind, make_save_value (stream, 0));
908 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
909 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
910 record_unwind_protect (load_unwind, lispstream);
911 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 909 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
912 specbind (Qload_file_name, found); 910 specbind (Qload_file_name, found);
913 specbind (Qinhibit_file_name_operation, Qnil); 911 specbind (Qinhibit_file_name_operation, Qnil);
@@ -957,11 +955,12 @@ Return t if file exists. */)
957} 955}
958 956
959static Lisp_Object 957static Lisp_Object
960load_unwind (stream) /* used as unwind-protect function in load */ 958load_unwind (arg) /* used as unwind-protect function in load */
961 Lisp_Object stream; 959 Lisp_Object arg;
962{ 960{
963 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 961 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
964 | XFASTINT (XCDR (stream)))); 962 if (stream != NULL)
963 fclose (stream);
965 if (--load_in_progress < 0) load_in_progress = 0; 964 if (--load_in_progress < 0) load_in_progress = 0;
966 return Qnil; 965 return Qnil;
967} 966}
@@ -1453,6 +1452,7 @@ This function preserves the position of point. */)
1453 if (NILP (filename)) 1452 if (NILP (filename))
1454 filename = XBUFFER (buf)->filename; 1453 filename = XBUFFER (buf)->filename;
1455 1454
1455 specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
1456 specbind (Qstandard_output, tem); 1456 specbind (Qstandard_output, tem);
1457 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 1457 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1458 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); 1458 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
@@ -1488,6 +1488,7 @@ This function does not move point. */)
1488 else 1488 else
1489 tem = printflag; 1489 tem = printflag;
1490 specbind (Qstandard_output, tem); 1490 specbind (Qstandard_output, tem);
1491 specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
1491 1492
1492 /* readevalloop calls functions which check the type of start and end. */ 1493 /* readevalloop calls functions which check the type of start and end. */
1493 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, 1494 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
@@ -3962,6 +3963,10 @@ to load. See also `load-dangerous-libraries'. */);
3962 Vbytecomp_version_regexp 3963 Vbytecomp_version_regexp
3963 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); 3964 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
3964 3965
3966 DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list,
3967 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
3968 Veval_buffer_list = Qnil;
3969
3965 /* Vsource_directory was initialized in init_lread. */ 3970 /* Vsource_directory was initialized in init_lread. */
3966 3971
3967 load_descriptor_list = Qnil; 3972 load_descriptor_list = Qnil;
@@ -4003,11 +4008,15 @@ to load. See also `load-dangerous-libraries'. */);
4003 Qload_file_name = intern ("load-file-name"); 4008 Qload_file_name = intern ("load-file-name");
4004 staticpro (&Qload_file_name); 4009 staticpro (&Qload_file_name);
4005 4010
4011 Qeval_buffer_list = intern ("eval-buffer-list");
4012 staticpro (&Qeval_buffer_list);
4013
4006 staticpro (&dump_path); 4014 staticpro (&dump_path);
4007 4015
4008 staticpro (&read_objects); 4016 staticpro (&read_objects);
4009 read_objects = Qnil; 4017 read_objects = Qnil;
4010 staticpro (&seen_list); 4018 staticpro (&seen_list);
4019 seen_list = Qnil;
4011 4020
4012 Vloads_in_progress = Qnil; 4021 Vloads_in_progress = Qnil;
4013 staticpro (&Vloads_in_progress); 4022 staticpro (&Vloads_in_progress);