sensible message when lookup does not find the manual directory
svn: r3812
This commit is contained in:
parent
bf79bf1dad
commit
1e1dfdc13c
|
@ -47,26 +47,24 @@
|
||||||
(finddoc-page-help manual index-key #t))
|
(finddoc-page-help manual index-key #t))
|
||||||
|
|
||||||
(define ht (make-hash-table))
|
(define ht (make-hash-table))
|
||||||
|
|
||||||
;; 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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user