diff options
| author | Richard M. Stallman | 1993-05-19 16:50:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-19 16:50:17 +0000 |
| commit | 8a1f153784a99aa5e5dc845c98c62c76687fc25d (patch) | |
| tree | 90d5dd597faa09edd4971d20fa1599050bc1f5c5 /src | |
| parent | 8f1e8ff04f817a100fecc700ccb36deff8148675 (diff) | |
| download | emacs-8a1f153784a99aa5e5dc845c98c62c76687fc25d.tar.gz emacs-8a1f153784a99aa5e5dc845c98c62c76687fc25d.zip | |
(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')
| -rw-r--r-- | src/lread.c | 34 |
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. */ | |||
| 51 | #include <math.h> | 51 | #include <math.h> |
| 52 | #endif /* LISP_FLOAT_TYPE */ | 52 | #endif /* LISP_FLOAT_TYPE */ |
| 53 | 53 | ||
| 54 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input; | 54 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; |
| 55 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; | 55 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; |
| 56 | Lisp_Object Qascii_character; | 56 | Lisp_Object Qascii_character; |
| 57 | 57 | ||
| @@ -535,6 +535,10 @@ build_load_history (stream, source) | |||
| 535 | register Lisp_Object tem, tem2; | 535 | register Lisp_Object tem, tem2; |
| 536 | register int foundit, loading; | 536 | register int foundit, loading; |
| 537 | 537 | ||
| 538 | /* Don't bother recording anything for preloaded files. */ | ||
| 539 | if (!NILP (Vpurify_flag)) | ||
| 540 | return; | ||
| 541 | |||
| 538 | loading = stream || !NARROWED; | 542 | loading = stream || !NARROWED; |
| 539 | 543 | ||
| 540 | tail = Vload_history; | 544 | tail = Vload_history; |
| @@ -582,12 +586,12 @@ build_load_history (stream, source) | |||
| 582 | QUIT; | 586 | QUIT; |
| 583 | } | 587 | } |
| 584 | 588 | ||
| 585 | /* If we're loading, cons the new assoc onto the front of load-history, | 589 | /* If we're loading, cons the new assoc onto the front of load-history, |
| 586 | the most-recently-loaded position. Also do this if we didn't find | 590 | the most-recently-loaded position. Also do this if we didn't find |
| 587 | an existing member for the current source. */ | 591 | an existing member for the current source. */ |
| 588 | if (loading || !foundit) | 592 | if (loading || !foundit) |
| 589 | Vload_history = Fcons (Fnreverse(Vcurrent_load_list), | 593 | Vload_history = Fcons (Fnreverse (Vcurrent_load_list), |
| 590 | Vload_history); | 594 | Vload_history); |
| 591 | } | 595 | } |
| 592 | 596 | ||
| 593 | Lisp_Object | 597 | Lisp_Object |
| @@ -607,16 +611,14 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag) | |||
| 607 | { | 611 | { |
| 608 | register int c; | 612 | register int c; |
| 609 | register Lisp_Object val; | 613 | register Lisp_Object val; |
| 610 | Lisp_Object oldlist; | ||
| 611 | int count = specpdl_ptr - specpdl; | 614 | int count = specpdl_ptr - specpdl; |
| 612 | struct gcpro gcpro1, gcpro2; | 615 | struct gcpro gcpro1; |
| 613 | 616 | ||
| 614 | specbind (Qstandard_input, readcharfun); | 617 | specbind (Qstandard_input, readcharfun); |
| 618 | specbind (Qcurrent_load_list, Qnil); | ||
| 615 | 619 | ||
| 616 | oldlist = Vcurrent_load_list; | 620 | GCPRO1 (sourcename); |
| 617 | GCPRO2 (sourcename, oldlist); | ||
| 618 | 621 | ||
| 619 | Vcurrent_load_list = Qnil; | ||
| 620 | LOADHIST_ATTACH (sourcename); | 622 | LOADHIST_ATTACH (sourcename); |
| 621 | 623 | ||
| 622 | while (1) | 624 | while (1) |
| @@ -655,8 +657,6 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag) | |||
| 655 | } | 657 | } |
| 656 | 658 | ||
| 657 | build_load_history (stream, sourcename); | 659 | build_load_history (stream, sourcename); |
| 658 | |||
| 659 | Vcurrent_load_list = oldlist; | ||
| 660 | UNGCPRO; | 660 | UNGCPRO; |
| 661 | 661 | ||
| 662 | unbind_to (count, Qnil); | 662 | unbind_to (count, Qnil); |
| @@ -1876,9 +1876,13 @@ The remaining elements of each list are symbols defined as functions\n\ | |||
| 1876 | or variables, and cons cells `(provide . FEATURE)' and `(require . FEATURE)'."); | 1876 | or variables, and cons cells `(provide . FEATURE)' and `(require . FEATURE)'."); |
| 1877 | Vload_history = Qnil; | 1877 | Vload_history = Qnil; |
| 1878 | 1878 | ||
| 1879 | staticpro (&Vcurrent_load_list); | 1879 | DEFVAR_LISP ("current-load-list", &Vcurrent_load_list, |
| 1880 | "Used for internal purposes by `load'."); | ||
| 1880 | Vcurrent_load_list = Qnil; | 1881 | Vcurrent_load_list = Qnil; |
| 1881 | 1882 | ||
| 1883 | Qcurrent_load_list = intern ("current-load-list"); | ||
| 1884 | staticpro (&Qcurrent_load_list); | ||
| 1885 | |||
| 1882 | Qstandard_input = intern ("standard-input"); | 1886 | Qstandard_input = intern ("standard-input"); |
| 1883 | staticpro (&Qstandard_input); | 1887 | staticpro (&Qstandard_input); |
| 1884 | 1888 | ||