summaryrefslogtreecommitdiff
path: root/libguile/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/load.c')
-rw-r--r--libguile/load.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libguile/load.c b/libguile/load.c
index b06fd7730..3b6ba2b38 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -806,6 +806,11 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1,
SCM filename, exception_on_not_found;
SCM full_filename, compiled_filename;
int compiled_is_fallback = 0;
+ SCM hook = *scm_loc_load_hook;
+
+ if (scm_is_true (hook) && scm_is_false (scm_procedure_p (hook)))
+ SCM_MISC_ERROR ("value of %load-hook is neither a procedure nor #f",
+ SCM_EOL);
if (scm_is_string (args))
{
@@ -870,6 +875,10 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1,
return SCM_BOOL_F;
}
+ if (!scm_is_false (hook))
+ scm_call_1 (hook, (scm_is_true (full_filename)
+ ? full_filename : compiled_filename));
+
if (scm_is_false (full_filename)
|| (scm_is_true (compiled_filename)
&& compiled_is_fresh (full_filename, compiled_filename)))