diff options
| author | Richard M. Stallman | 2005-10-23 17:25:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-10-23 17:25:43 +0000 |
| commit | b502a9a160600bbf6c118751fd6ff561c27a8119 (patch) | |
| tree | 722d6219d6dec4ad72168e97221f5cd3f3f8d851 /src | |
| parent | bd4244cbf85e5c46d4331a1bc0bbac2771a06a82 (diff) | |
| download | emacs-b502a9a160600bbf6c118751fd6ff561c27a8119.tar.gz emacs-b502a9a160600bbf6c118751fd6ff561c27a8119.zip | |
(build_load_history): Replace STREAM arg with ENTIRE.
(readevalloop): Compute ENTIRE properly.
(syms_of_lread) <load-history>: Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/lread.c b/src/lread.c index 86ceb8314a4..3097a6b7c3e 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1198,33 +1198,34 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1198 | 1198 | ||
| 1199 | /* Merge the list we've accumulated of globals from the current input source | 1199 | /* Merge the list we've accumulated of globals from the current input source |
| 1200 | into the load_history variable. The details depend on whether | 1200 | into the load_history variable. The details depend on whether |
| 1201 | the source has an associated file name or not. */ | 1201 | the source has an associated file name or not. |
| 1202 | |||
| 1203 | FILENAME is the file name that we are loading from. | ||
| 1204 | ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */ | ||
| 1202 | 1205 | ||
| 1203 | static void | 1206 | static void |
| 1204 | build_load_history (stream, source) | 1207 | build_load_history (filename, entire) |
| 1205 | FILE *stream; | 1208 | Lisp_Object filename; |
| 1206 | Lisp_Object source; | 1209 | int entire; |
| 1207 | { | 1210 | { |
| 1208 | register Lisp_Object tail, prev, newelt; | 1211 | register Lisp_Object tail, prev, newelt; |
| 1209 | register Lisp_Object tem, tem2; | 1212 | register Lisp_Object tem, tem2; |
| 1210 | register int foundit, loading; | 1213 | register int foundit = 0; |
| 1211 | |||
| 1212 | loading = stream || !NARROWED; | ||
| 1213 | 1214 | ||
| 1214 | tail = Vload_history; | 1215 | tail = Vload_history; |
| 1215 | prev = Qnil; | 1216 | prev = Qnil; |
| 1216 | foundit = 0; | 1217 | |
| 1217 | while (CONSP (tail)) | 1218 | while (CONSP (tail)) |
| 1218 | { | 1219 | { |
| 1219 | tem = XCAR (tail); | 1220 | tem = XCAR (tail); |
| 1220 | 1221 | ||
| 1221 | /* Find the feature's previous assoc list... */ | 1222 | /* Find the feature's previous assoc list... */ |
| 1222 | if (!NILP (Fequal (source, Fcar (tem)))) | 1223 | if (!NILP (Fequal (filename, Fcar (tem)))) |
| 1223 | { | 1224 | { |
| 1224 | foundit = 1; | 1225 | foundit = 1; |
| 1225 | 1226 | ||
| 1226 | /* If we're loading, remove it. */ | 1227 | /* If we're loading the entire file, remove old data. */ |
| 1227 | if (loading) | 1228 | if (entire) |
| 1228 | { | 1229 | { |
| 1229 | if (NILP (prev)) | 1230 | if (NILP (prev)) |
| 1230 | Vload_history = XCDR (tail); | 1231 | Vload_history = XCDR (tail); |
| @@ -1256,10 +1257,10 @@ build_load_history (stream, source) | |||
| 1256 | QUIT; | 1257 | QUIT; |
| 1257 | } | 1258 | } |
| 1258 | 1259 | ||
| 1259 | /* If we're loading, cons the new assoc onto the front of load-history, | 1260 | /* If we're loading an entire file, cons the new assoc onto the |
| 1260 | the most-recently-loaded position. Also do this if we didn't find | 1261 | front of load-history, the most-recently-loaded position. Also |
| 1261 | an existing member for the current source. */ | 1262 | do this if we didn't find an existing member for the file. */ |
| 1262 | if (loading || !foundit) | 1263 | if (entire || !foundit) |
| 1263 | Vload_history = Fcons (Fnreverse (Vcurrent_load_list), | 1264 | Vload_history = Fcons (Fnreverse (Vcurrent_load_list), |
| 1264 | Vload_history); | 1265 | Vload_history); |
| 1265 | } | 1266 | } |
| @@ -1414,7 +1415,9 @@ readevalloop (readcharfun, stream, sourcename, evalfun, | |||
| 1414 | } | 1415 | } |
| 1415 | } | 1416 | } |
| 1416 | 1417 | ||
| 1417 | build_load_history (stream, sourcename); | 1418 | build_load_history (sourcename, |
| 1419 | stream || (start == BEG && end == Z)); | ||
| 1420 | |||
| 1418 | UNGCPRO; | 1421 | UNGCPRO; |
| 1419 | 1422 | ||
| 1420 | unbind_to (count, Qnil); | 1423 | unbind_to (count, Qnil); |
| @@ -3896,8 +3899,8 @@ An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)', | |||
| 3896 | and means that SYMBOL was an autoload before this file redefined it | 3899 | and means that SYMBOL was an autoload before this file redefined it |
| 3897 | as a function. | 3900 | as a function. |
| 3898 | 3901 | ||
| 3899 | For a preloaded file, the file name recorded is relative to the main Lisp | 3902 | During preloading, the file name recorded is relative to the main Lisp |
| 3900 | directory. These names are converted to absolute by `file-loadhist-lookup'. */); | 3903 | directory. These file names are converted to absolute at startup. */); |
| 3901 | Vload_history = Qnil; | 3904 | Vload_history = Qnil; |
| 3902 | 3905 | ||
| 3903 | DEFVAR_LISP ("load-file-name", &Vload_file_name, | 3906 | DEFVAR_LISP ("load-file-name", &Vload_file_name, |