diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index b3cbcb067..2a2e32fd8 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,10 @@ +1998-06-19 Mikael Djurfeldt + + * boot-9.scm (load-module): When loading files from within files + themselves being loaded: Use the directory path of the file being + loaded as root for relative filenames. (After suggestion by + Steven G. Johnson.) + 1998-06-15 Mikael Djurfeldt * emacs.scm (emacs-load): New feature: Eval in specified module. diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 105c1f71c..158a4c582 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -1664,8 +1664,17 @@ (define basic-load load) -(define (load-module . args) - (save-module-excursion (lambda () (apply basic-load args)))) +(define (load-module filename) + (save-module-excursion + (lambda () + (let ((oldname (and (current-load-port) + (port-filename (current-load-port))))) + (basic-load (if (and oldname + (> (string-length filename) 0) + (not (char=? (string-ref filename 0) #\/)) + (not (string=? (dirname oldname) "."))) + (string-append (dirname oldname) "/" filename) + filename)))))) @@ -2792,8 +2801,6 @@ (define load load-module) -;(define (load . args) -; (start-stack 'load-stack (apply load-module args)))