sensible message when lookup does not find the manual directory

svn: r3812
This commit is contained in:
Eli Barzilay 2006-07-25 18:22:19 +00:00
parent bf79bf1dad
commit 1e1dfdc13c

View File

@ -51,22 +51,20 @@
;; returns either a string (failure) or ;; returns either a string (failure) or
;; (list docdir index-key filename anchor title) ;; (list docdir index-key filename anchor title)
(define (lookup manual index-key label) (define (lookup manual index-key label)
(let ([key (string->symbol manual)] (let* ([key (string->symbol manual)]
[docdir (find-doc-directory manual)]) [docdir (find-doc-directory manual)]
(let ([l (hash-table-get [l (hash-table-get ht key
ht (lambda ()
key (let ([f (and docdir (build-path docdir "hdindex"))])
(lambda () (if (and f (file-exists? f))
(let ([f (build-path docdir "hdindex")]) (let ([l (with-input-from-file f read)])
(if (file-exists? f) (hash-table-put! ht key l)
(let ([l (with-input-from-file f read)]) l)
(hash-table-put! ht key l) (error 'finddoc "manual index ~s not installed" manual)))))]
l) [m (assoc index-key l)])
(error 'finddoc "manual index ~s not installed" manual)))))]) (if m
(let ([m (assoc index-key l)]) (cons docdir m)
(if m (error 'finddoc "index key ~s not found in manual ~s" index-key manual))))
(cons docdir m)
(error 'finddoc "index key ~s not found in manual ~s" index-key manual))))))
;; finds the full path of the doc directory, if one exists ;; finds the full path of the doc directory, if one exists
;; input is just the short name of the directory (as a path) ;; input is just the short name of the directory (as a path)