comparison src/lread.c @ 83395:b31326248cf6

Merged from miles@gnu.org--gnu-2005 (patch 142-148, 615-628) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-615 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-616 Add lisp/mh-e/.arch-inventory * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-617 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-618 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-619 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-620 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-621 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-622 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-623 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-624 Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-625 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-626 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-627 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-628 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-142 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-143 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-144 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-145 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-146 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-147 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-148 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-435
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 01 Nov 2005 06:23:08 +0000
parents 732c5740ca8f 087e7eef40d2
children 693e794b57bf
comparison
equal deleted inserted replaced
83394:7d093d9d4479 83395:b31326248cf6
1197 } 1197 }
1198 1198
1199 1199
1200 /* Merge the list we've accumulated of globals from the current input source 1200 /* Merge the list we've accumulated of globals from the current input source
1201 into the load_history variable. The details depend on whether 1201 into the load_history variable. The details depend on whether
1202 the source has an associated file name or not. */ 1202 the source has an associated file name or not.
1203
1204 FILENAME is the file name that we are loading from.
1205 ENTIRE is 1 if loading that entire file, 0 if evaluating part of it. */
1203 1206
1204 static void 1207 static void
1205 build_load_history (stream, source) 1208 build_load_history (filename, entire)
1206 FILE *stream; 1209 Lisp_Object filename;
1207 Lisp_Object source; 1210 int entire;
1208 { 1211 {
1209 register Lisp_Object tail, prev, newelt; 1212 register Lisp_Object tail, prev, newelt;
1210 register Lisp_Object tem, tem2; 1213 register Lisp_Object tem, tem2;
1211 register int foundit, loading; 1214 register int foundit = 0;
1212
1213 loading = stream || !NARROWED;
1214 1215
1215 tail = Vload_history; 1216 tail = Vload_history;
1216 prev = Qnil; 1217 prev = Qnil;
1217 foundit = 0; 1218
1218 while (CONSP (tail)) 1219 while (CONSP (tail))
1219 { 1220 {
1220 tem = XCAR (tail); 1221 tem = XCAR (tail);
1221 1222
1222 /* Find the feature's previous assoc list... */ 1223 /* Find the feature's previous assoc list... */
1223 if (!NILP (Fequal (source, Fcar (tem)))) 1224 if (!NILP (Fequal (filename, Fcar (tem))))
1224 { 1225 {
1225 foundit = 1; 1226 foundit = 1;
1226 1227
1227 /* If we're loading, remove it. */ 1228 /* If we're loading the entire file, remove old data. */
1228 if (loading) 1229 if (entire)
1229 { 1230 {
1230 if (NILP (prev)) 1231 if (NILP (prev))
1231 Vload_history = XCDR (tail); 1232 Vload_history = XCDR (tail);
1232 else 1233 else
1233 Fsetcdr (prev, XCDR (tail)); 1234 Fsetcdr (prev, XCDR (tail));
1255 prev = tail; 1256 prev = tail;
1256 tail = XCDR (tail); 1257 tail = XCDR (tail);
1257 QUIT; 1258 QUIT;
1258 } 1259 }
1259 1260
1260 /* If we're loading, cons the new assoc onto the front of load-history, 1261 /* If we're loading an entire file, cons the new assoc onto the
1261 the most-recently-loaded position. Also do this if we didn't find 1262 front of load-history, the most-recently-loaded position. Also
1262 an existing member for the current source. */ 1263 do this if we didn't find an existing member for the file. */
1263 if (loading || !foundit) 1264 if (entire || !foundit)
1264 Vload_history = Fcons (Fnreverse (Vcurrent_load_list), 1265 Vload_history = Fcons (Fnreverse (Vcurrent_load_list),
1265 Vload_history); 1266 Vload_history);
1266 } 1267 }
1267 1268
1268 Lisp_Object 1269 Lisp_Object
1413 else 1414 else
1414 Fprint (val, Qnil); 1415 Fprint (val, Qnil);
1415 } 1416 }
1416 } 1417 }
1417 1418
1418 build_load_history (stream, sourcename); 1419 build_load_history (sourcename,
1420 stream || (start == BEG && end == Z));
1421
1419 UNGCPRO; 1422 UNGCPRO;
1420 1423
1421 unbind_to (count, Qnil); 1424 unbind_to (count, Qnil);
1422 } 1425 }
1423 1426
3895 `(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'. 3898 `(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
3896 An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)', 3899 An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
3897 and means that SYMBOL was an autoload before this file redefined it 3900 and means that SYMBOL was an autoload before this file redefined it
3898 as a function. 3901 as a function.
3899 3902
3900 For a preloaded file, the file name recorded is relative to the main Lisp 3903 During preloading, the file name recorded is relative to the main Lisp
3901 directory. These names are converted to absolute by `file-loadhist-lookup'. */); 3904 directory. These file names are converted to absolute at startup. */);
3902 Vload_history = Qnil; 3905 Vload_history = Qnil;
3903 3906
3904 DEFVAR_LISP ("load-file-name", &Vload_file_name, 3907 DEFVAR_LISP ("load-file-name", &Vload_file_name,
3905 doc: /* Full name of file being loaded by `load'. */); 3908 doc: /* Full name of file being loaded by `load'. */);
3906 Vload_file_name = Qnil; 3909 Vload_file_name = Qnil;