commit e2e36b404e96bf3f5c68a0e1ec6a28e4de6b88ac
parent c2788702f80d56587261aae5a50d81c8e9f06e5b
Author: Eli Barzilay <eli@racket-lang.org>
Date: Tue, 29 Jan 2008 21:38:27 +0000
* Added send-url/file that consumes a path and adds the file://, use
that in places that show docs.
* Made send-url quote characters that are possibly dangerous for
subprocesses (good uses should call it wil already quoted urls).
Also a keyword argument that can disable this, if someone really
wants to.
* IE7 bug workaround finally working (but will need to switch from
regedit to mred, to avoid vista warning).
svn: r8467
original commit: dbd27dafc66d0b94924e4287e60bdb3903fad215
Diffstat:
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/collects/help/search.ss b/collects/help/search.ss
@@ -18,11 +18,10 @@
[send-main-page (-> void?)])
(define (send-main-page)
- (let ([user-dest-path (build-path (find-user-doc-dir) "index.html")]
- [dest-path (build-path (find-doc-dir) "index.html")])
- (send-url (format "file://~a" (path->string (if (file-exists? user-dest-path)
- user-dest-path
- dest-path))))))
+ (let* ([path (build-path (find-user-doc-dir) "index.html")]
+ [path (if (file-exists? path)
+ path (build-path (find-doc-dir) "index.html"))])
+ (send-url/file path)))
;; if there is exactly one exact match for this search key, go directly
;; to that place. Otherwise, go to a page that lists all of the matches.
@@ -40,9 +39,7 @@
[else
(let ([match (car exact-matches)])
(let-values ([(path tag) (xref-tag->path+anchor x (entry-tag match))])
- (send-url (format "file://~a~a"
- (path->string path)
- (if tag (string-append "#" (uri-encode tag)) "")))))])))
+ (send-url/file path #:fragment (uri-encode tag))))])))
(define (generate-search-results search-keys)
(let ([file (next-search-results-file)]
@@ -75,7 +72,7 @@
(build-itemization "Exact matches" exact-matches)
(build-itemization "Containing matches" inexact-matches))]))))
file)
- (send-url (format "file://~a" (path->string file)))
+ (send-url/file file)
(void))))
(define (make-extra-content desc)