summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-22 10:02:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-22 10:02:26 -0800
commitc2906d9e4e686a7ee34bc47200d391ca88307755 (patch)
tree0cff499ca7bd8047672603df06311bce001f36a6 /match.c
parentc9838a34a60b15bab4c702f66ebfc17b15a03ba2 (diff)
downloadtxr-c2906d9e4e686a7ee34bc47200d391ca88307755.tar.gz
txr-c2906d9e4e686a7ee34bc47200d391ca88307755.tar.bz2
txr-c2906d9e4e686a7ee34bc47200d391ca88307755.zip
Dump deferred warnings in @(load).
* match.c (v_load): Bind *load-recursive* to t around the loading, and dump deferred warnings afterward if the previous value of *load-recursive* is nil.
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/match.c b/match.c
index 6ad9ac6a..a97a2b65 100644
--- a/match.c
+++ b/match.c
@@ -3986,6 +3986,7 @@ static val v_load(match_files_ctx *c)
val txr_lisp_p = nil;
val ret = nil;
val saved_dyn_env = dyn_env;
+ val rec = cdr(lookup_var(saved_dyn_env, load_recursive_s));
open_txr_file(path, &txr_lisp_p, &name, &stream);
@@ -3993,6 +3994,7 @@ static val v_load(match_files_ctx *c)
dyn_env = make_env(nil, nil, dyn_env);
env_vbind(dyn_env, load_path_s, name);
+ env_vbind(dyn_env, load_recursive_s, t);
if (!txr_lisp_p) {
int gc = gc_state(0);
@@ -4046,6 +4048,8 @@ static val v_load(match_files_ctx *c)
uw_unwind {
close_stream(stream, nil);
+ if (!rec)
+ uw_dump_deferred_warnings(std_null);
}
uw_catch_end;