aboutsummaryrefslogtreecommitdiffstats
path: root/guile.init
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <tb@debian.org>2006-01-16 11:20:16 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:33 -0800
commitff9cb66fee88a090869a2fb452ad49d858fe3b0c (patch)
tree7979e0ae8599c6e471f278dcdaefe35866689b71 /guile.init
parent1dd333954bcb8f993ebbd8fcf25f728f290a7942 (diff)
downloadslib-ff9cb66fee88a090869a2fb452ad49d858fe3b0c.tar.gz
slib-ff9cb66fee88a090869a2fb452ad49d858fe3b0c.zip
Import Debian changes 3a2-5debian/3a2-5
slib (3a2-5) unstable; urgency=low * guile.init (slib:load): Use the version that used to be in guile, which searches paths (not relevant to the present bug) and makes sure that loaded files land in the slib module (the cause of the present bug). * debian/control (slib): No longer conflict with gnucash of any version.
Diffstat (limited to 'guile.init')
-rw-r--r--guile.init22
1 files changed, 20 insertions, 2 deletions
diff --git a/guile.init b/guile.init
index c1a74f8..9fd36d9 100644
--- a/guile.init
+++ b/guile.init
@@ -370,8 +370,26 @@
;;; (let ((load-file (guile:wrap-case-insensitive load)))
;;; (lambda (<pathname>)
;;; (load-file (string-append <pathname> (scheme-file-suffix))))))
-(define (slib:load <pathname>)
- (load (string-append <pathname> (scheme-file-suffix))))
+;; Two changes from the normal slib thing here:
+;; 1. Load from the path
+;; 2. Importantly: guarantee that loaded files land in the slib module.
+(define (slib:load name)
+ (save-module-excursion
+ (lambda ()
+ (set-current-module slib-module)
+ (let ((errinfo (catch 'system-error
+ (lambda ()
+ (load-from-path name)
+ #f)
+ (lambda args args))))
+ (if (and errinfo
+ (catch 'system-error
+ (lambda ()
+ (load-from-path
+ (string-append name ".scm"))
+ #f)
+ (lambda args args)))
+ (apply throw errinfo))))))
(define slib:load-source slib:load)