removed some unnecessary old autoloading, reformat some stuff
svn: r11886
This commit is contained in:
parent
59b1eea0bc
commit
4efab4f12f
|
@ -3,6 +3,7 @@
|
||||||
(require setup/xref
|
(require setup/xref
|
||||||
scribble/xref
|
scribble/xref
|
||||||
scribble/manual-struct
|
scribble/manual-struct
|
||||||
|
help/search
|
||||||
net/uri-codec
|
net/uri-codec
|
||||||
net/sendurl
|
net/sendurl
|
||||||
scheme/path
|
scheme/path
|
||||||
|
@ -13,16 +14,13 @@
|
||||||
(define-namespace-anchor anchor)
|
(define-namespace-anchor anchor)
|
||||||
|
|
||||||
(define (find-help/lib sym lib)
|
(define (find-help/lib sym lib)
|
||||||
(let ([id (parameterize ([current-namespace (namespace-anchor->empty-namespace
|
(let ([id (parameterize ([current-namespace
|
||||||
anchor)])
|
(namespace-anchor->empty-namespace anchor)])
|
||||||
(namespace-require `(for-label ,lib))
|
(namespace-require `(for-label ,lib))
|
||||||
(namespace-syntax-introduce (datum->syntax #f sym)))])
|
(namespace-syntax-introduce (datum->syntax #f sym)))])
|
||||||
(if (identifier-label-binding id)
|
(if (identifier-label-binding id)
|
||||||
(find-help id)
|
(find-help id)
|
||||||
(error 'help
|
(error 'help "no binding for identifier: ~a from module: ~a" sym lib))))
|
||||||
"no binding for identifier: ~a from module: ~a"
|
|
||||||
sym
|
|
||||||
lib))))
|
|
||||||
|
|
||||||
(define (find-help id)
|
(define (find-help id)
|
||||||
(let* ([lb (identifier-label-binding id)]
|
(let* ([lb (identifier-label-binding id)]
|
||||||
|
@ -31,10 +29,7 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(printf "Loading help index...\n")))])
|
(printf "Loading help index...\n")))])
|
||||||
(if (or lb b)
|
(if (or lb b)
|
||||||
(let ([tag (xref-binding->definition-tag
|
(let ([tag (xref-binding->definition-tag xref (or lb b) (if lb #f 0))])
|
||||||
xref
|
|
||||||
(or lb b)
|
|
||||||
(if lb #f 0))])
|
|
||||||
(if tag
|
(if tag
|
||||||
(go-to-tag xref tag)
|
(go-to-tag xref tag)
|
||||||
(error 'help
|
(error 'help
|
||||||
|
@ -46,11 +41,11 @@
|
||||||
(define (search-for-exports xref sym)
|
(define (search-for-exports xref sym)
|
||||||
(let ([idx (xref-index xref)]
|
(let ([idx (xref-index xref)]
|
||||||
[libs null])
|
[libs null])
|
||||||
(for-each (lambda (entry)
|
(for ([entry (in-list idx)])
|
||||||
(when (exported-index-desc? (entry-desc entry))
|
(when (and (exported-index-desc? (entry-desc entry))
|
||||||
(when (eq? sym (exported-index-desc-name (entry-desc entry)))
|
(eq? sym (exported-index-desc-name (entry-desc entry))))
|
||||||
(set! libs (append libs (exported-index-desc-from-libs (entry-desc entry)))))))
|
(set! libs (append libs (exported-index-desc-from-libs
|
||||||
idx)
|
(entry-desc entry))))))
|
||||||
(if (null? libs)
|
(if (null? libs)
|
||||||
(printf "Not found in any library's documentation: ~a\n" sym)
|
(printf "Not found in any library's documentation: ~a\n" sym)
|
||||||
(begin
|
(begin
|
||||||
|
@ -68,15 +63,5 @@
|
||||||
(unless (send-url/file file #:fragment (and anchor (uri-encode anchor)))
|
(unless (send-url/file file #:fragment (and anchor (uri-encode anchor)))
|
||||||
(error 'help "browser launch failed"))))
|
(error 'help "browser launch failed"))))
|
||||||
|
|
||||||
(define generate-search-results #f)
|
|
||||||
|
|
||||||
(define (search-for strs)
|
(define (search-for strs)
|
||||||
(printf "Generating and opening search page...\n")
|
(perform-search (apply string-append (add-between strs " "))))
|
||||||
(unless generate-search-results
|
|
||||||
(parameterize ([current-namespace (namespace-anchor->empty-namespace
|
|
||||||
anchor)])
|
|
||||||
(set! generate-search-results
|
|
||||||
(dynamic-require 'help/search 'perform-search))))
|
|
||||||
(generate-search-results (apply string-append
|
|
||||||
(add-between strs " "))))
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user