mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-28 01:00:52 -07:00
(load_depth): New variable.
(Fload, load_unwind, init_lread): Set it to the load recursion depth; set load_in_progress as a simple boolean based on the current load_depth. (Bug#3892)
This commit is contained in:
parent
0b5546d610
commit
ece435a536
2 changed files with 15 additions and 2 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2009-07-21 Ken Raeburn <raeburn@raeburn.org>
|
||||
|
||||
* lread.c (load_depth): New variable.
|
||||
(Fload, load_unwind, init_lread): Set it to the load recursion
|
||||
depth; set load_in_progress as a simple boolean based on the
|
||||
current load_depth. (Bug#3892)
|
||||
|
||||
2009-07-20 Adrian Robert <Adrian.B.Robert@gmail.com>
|
||||
|
||||
* nsfont.m (ns_has_attribute): Remove.
|
||||
|
|
|
|||
10
src/lread.c
10
src/lread.c
|
|
@ -100,6 +100,9 @@ extern Lisp_Object Qfile_exists_p;
|
|||
/* non-zero if inside `load' */
|
||||
int load_in_progress;
|
||||
|
||||
/* Depth of nested `load' invocations. */
|
||||
int load_depth;
|
||||
|
||||
/* Directory in which the sources were found. */
|
||||
Lisp_Object Vsource_directory;
|
||||
|
||||
|
|
@ -1250,7 +1253,8 @@ Return t if the file exists and loads successfully. */)
|
|||
specbind (Qinhibit_file_name_operation, Qnil);
|
||||
load_descriptor_list
|
||||
= Fcons (make_number (fileno (stream)), load_descriptor_list);
|
||||
load_in_progress++;
|
||||
load_depth++;
|
||||
load_in_progress = 1;
|
||||
if (! version || version >= 22)
|
||||
readevalloop (Qget_file_char, stream, hist_file_name,
|
||||
Feval, 0, Qnil, Qnil, Qnil, Qnil);
|
||||
|
|
@ -1312,7 +1316,8 @@ load_unwind (arg) /* used as unwind-protect function in load */
|
|||
fclose (stream);
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
if (--load_in_progress < 0) load_in_progress = 0;
|
||||
if (--load_depth < 0) load_depth = 0;
|
||||
load_in_progress = load_depth > 0;
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
|
@ -4129,6 +4134,7 @@ init_lread ()
|
|||
Vvalues = Qnil;
|
||||
|
||||
load_in_progress = 0;
|
||||
load_depth = 0;
|
||||
Vload_file_name = Qnil;
|
||||
|
||||
load_descriptor_list = Qnil;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue