summaryrefslogtreecommitdiffstats
path: root/schmooz.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:38 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:38 -0800
commit64f037d91e0c9296dcaef9a0ff3eb33b19a2ed34 (patch)
tree1b23b8e8005328194e2fb4bf653806c85050933f /schmooz.scm
parent5bea21e81ed516440e34e480f2c33ca41aa8c597 (diff)
downloadslib-64f037d91e0c9296dcaef9a0ff3eb33b19a2ed34.tar.gz
slib-64f037d91e0c9296dcaef9a0ff3eb33b19a2ed34.zip
Import Upstream version 3a5upstream/3a5
Diffstat (limited to 'schmooz.scm')
-rw-r--r--schmooz.scm16
1 files changed, 14 insertions, 2 deletions
diff --git a/schmooz.scm b/schmooz.scm
index 75ddfa7..39785f3 100644
--- a/schmooz.scm
+++ b/schmooz.scm
@@ -359,6 +359,15 @@
((not (and (char? chr) (not (char-whitespace? chr)))) str)
(read-char port)))
+(define (pathname->local-filename path)
+ (define vic (pathname->vicinity path))
+ (define plen (string-length path))
+ (let ((vlen (string-length vic)))
+ (if (and (substring? vic path)
+ (< vlen plen))
+ (in-vicinity (user-vicinity) (substring path vlen plen))
+ (slib:error 'pathname->local-filename path))))
+
;;;@ SCHMOOZ files.
(define schmooz
(let* ((scheme-file? (filename:match-ci?? "*??scm"))
@@ -400,9 +409,12 @@
(define sl (string-length file))
(cond ((texi-file? file) (schmooz-texi-file file))
((scheme-file? file)
- (schmooz-scm-file file (scm->txi file)))
+ (schmooz-scm-file
+ file (pathname->local-filename (scm->txi file))))
(else (schmooz-scm-file
- file (string-append file ".txi")))))
+ file
+ (pathname->local-filename
+ (string-append file ".txi"))))))
files))))
;;; SCHMOOZ-TOPS - schmooz top level forms.