summaryrefslogtreecommitdiffstats
path: root/top-refs.scm
diff options
context:
space:
mode:
Diffstat (limited to 'top-refs.scm')
-rw-r--r--top-refs.scm48
1 files changed, 26 insertions, 22 deletions
diff --git a/top-refs.scm b/top-refs.scm
index 29e25dc..3647dc4 100644
--- a/top-refs.scm
+++ b/top-refs.scm
@@ -74,12 +74,13 @@
(define (top-refs:include filename)
(cond ((not (and (string? filename) (file-exists? filename)))
(top-refs:warn 'top-refs:include 'skipping filename))
- (else (fluid-let ((*load-pathname* filename))
- (call-with-input-file filename
- (lambda (port)
- (do ((exp (read port) (read port)))
- ((eof-object? exp))
- (top-refs:top-level exp))))))))
+ (else (call-with-input-file filename
+ (lambda (port)
+ (with-load-pathname filename
+ (lambda ()
+ (do ((exp (read port) (read port)))
+ ((eof-object? exp))
+ (top-refs:top-level exp)))))))))
(define (top-refs:top-level exp)
(cond ((not (and (pair? exp) (list? exp)))
@@ -238,7 +239,7 @@
;;@dots{} (info) indexes of @1. The identifiers have the case that
;;the implementation's @code{read} uses for symbols. Identifiers
;;containing spaces (eg. @code{close-base on base-table}) are
-;;@emph{not} included.
+;;@emph{not} included. #f is returned if the index is not found.
;;
;;Each info index is headed by a @samp{* Menu:} line. To list the
;;symbols in the first and third info indexes do:
@@ -266,20 +267,23 @@
(do ((line (read-line port) (read-line port)))
((or (eof-object? line)
(not (and (> (string-length line) 5)
- (string=? "* " (substring line 0 2)))))
+ (or (string=? "* " (substring line 0 2))
+ (substring? "(line " line)))))
(loop (read-line port) (+ 1 iidx) (cdr ndxs)))
- (let ((<n> (substring? " <" line)))
- (define csi (or (and <n>
- (> (string-length line) (+ 3 <n>))
- (string-index
- "0123456789"
- (string-ref line (+ 2 <n>)))
- <n>)
- (substring? ": " line)))
- (and
- csi
- (let ((str (substring line 2 csi)))
- (if (and (not (substring? " " str))
- (not (memq (string-ci->symbol str) exports)))
- (set! exports (cons (string-ci->symbol str) exports))))))))
+ (and
+ (string=? "* " (substring line 0 2))
+ (let ((<n> (substring? " <" line)))
+ (define csi (or (and <n>
+ (> (string-length line) (+ 3 <n>))
+ (string-index
+ "0123456789"
+ (string-ref line (+ 2 <n>)))
+ <n>)
+ (substring? ": " line)))
+ (and
+ csi
+ (let ((str (substring line 2 csi)))
+ (if (and (not (substring? " " str))
+ (not (memq (string-ci->symbol str) exports)))
+ (set! exports (cons (string-ci->symbol str) exports)))))))))
(else (loop (read-line port) (+ 1 iidx) ndxs))))))))