summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-05-19 16:50:17 +0000
committerRichard M. Stallman <rms@gnu.org>1993-05-19 16:50:17 +0000
commitf311815826ac617eab84bbb328c6e1d0e4405e3b (patch)
tree63570d55801562ddf2af2ba2690d085efbe247f0 /src/lread.c
parentb3b8f76a747736c75f8b07cab9d624b0bcdaacf3 (diff)
downloademacs-f311815826ac617eab84bbb328c6e1d0e4405e3b.tar.gz
(syms_of_lread): Make Vcurrent_load_list ordinary Lisp var.
Set up Qcurrent_load_list. (readevalloop): Specbind Qcurrent_load_list instead of ad-hoc saving. (build_load_history): Do nothing when loading pure files.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/lread.c b/src/lread.c
index aa211716a0a..f059f757a69 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -51,7 +51,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <math.h>
#endif /* LISP_FLOAT_TYPE */
-Lisp_Object Qread_char, Qget_file_char, Qstandard_input;
+Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list;
Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist;
Lisp_Object Qascii_character;
@@ -535,6 +535,10 @@ build_load_history (stream, source)
register Lisp_Object tem, tem2;
register int foundit, loading;
+ /* Don't bother recording anything for preloaded files. */
+ if (!NILP (Vpurify_flag))
+ return;
+
loading = stream || !NARROWED;
tail = Vload_history;
@@ -582,12 +586,12 @@ build_load_history (stream, source)
QUIT;
}
- /* If we're loading, cons the new assoc onto the front of load-history,
- the most-recently-loaded position. Also do this if we didn't find
- an existing member for the current source. */
- if (loading || !foundit)
- Vload_history = Fcons (Fnreverse(Vcurrent_load_list),
- Vload_history);
+ /* If we're loading, cons the new assoc onto the front of load-history,
+ the most-recently-loaded position. Also do this if we didn't find
+ an existing member for the current source. */
+ if (loading || !foundit)
+ Vload_history = Fcons (Fnreverse (Vcurrent_load_list),
+ Vload_history);
}
Lisp_Object
@@ -607,16 +611,14 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag)
{
register int c;
register Lisp_Object val;
- Lisp_Object oldlist;
int count = specpdl_ptr - specpdl;
- struct gcpro gcpro1, gcpro2;
+ struct gcpro gcpro1;
specbind (Qstandard_input, readcharfun);
+ specbind (Qcurrent_load_list, Qnil);
- oldlist = Vcurrent_load_list;
- GCPRO2 (sourcename, oldlist);
+ GCPRO1 (sourcename);
- Vcurrent_load_list = Qnil;
LOADHIST_ATTACH (sourcename);
while (1)
@@ -655,8 +657,6 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag)
}
build_load_history (stream, sourcename);
-
- Vcurrent_load_list = oldlist;
UNGCPRO;
unbind_to (count, Qnil);
@@ -1876,9 +1876,13 @@ The remaining elements of each list are symbols defined as functions\n\
or variables, and cons cells `(provide . FEATURE)' and `(require . FEATURE)'.");
Vload_history = Qnil;
- staticpro (&Vcurrent_load_list);
+ DEFVAR_LISP ("current-load-list", &Vcurrent_load_list,
+ "Used for internal purposes by `load'.");
Vcurrent_load_list = Qnil;
+ Qcurrent_load_list = intern ("current-load-list");
+ staticpro (&Qcurrent_load_list);
+
Qstandard_input = intern ("standard-input");
staticpro (&Qstandard_input);