From 3511d7725aa0ef80b2f5f486fe4f06262e31fd4a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 13 Sep 2009 15:33:24 +0000 Subject: [PATCH] refine no-doc-available message for unbound ids svn: r15991 --- collects/help/help-utils.ss | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/collects/help/help-utils.ss b/collects/help/help-utils.ss index 96890f4f52..32b5c19655 100644 --- a/collects/help/help-utils.ss +++ b/collects/help/help-utils.ss @@ -33,8 +33,8 @@ (define (find-help id) (let* ([lb (identifier-label-binding id)] [b (and (not lb) (identifier-binding id))] - [b (or lb b)] - [b (and (not (eq? 'lexical b)) b)] + [any-b (or lb b)] + [b (and (not (eq? 'lexical any-b)) any-b)] [xref (load-collections-xref (lambda () (printf "Loading help index...\n")))]) @@ -46,9 +46,9 @@ "no documentation found for: ~e provided by: ~a" (syntax-e id) (module-path-index-resolve (caddr b))))) - (search-for-exports xref (syntax-e id))))) + (search-for-exports xref (syntax-e id) any-b)))) -(define (search-for-exports xref sym) +(define (search-for-exports xref sym binding) (let ([idx (xref-index xref)] [libs null]) (for ([entry (in-list idx)]) @@ -59,7 +59,10 @@ (if (null? libs) (printf "Not found in any library's documentation: ~a\n" sym) (begin - (printf "No documentation for current binding, but provided by:\n") + (printf "~a, but provided by:\n" + (if binding + "No documentation available for binding" + "No current binding")) (let loop ([libs libs]) (unless (null? libs) (unless (member (car libs) (cdr libs))