use materialize-user-docs in drracket

closes PR 14844
This commit is contained in:
Robby Findler 2014-11-24 09:22:14 -06:00
parent 9d6265d9aa
commit eb0f88939a
2 changed files with 30 additions and 0 deletions

View File

@ -6,9 +6,11 @@
racket/class
net/url
setup/dirs
setup/materialize-user-docs
help/search
help/private/buginfo
drracket/private/drsig
string-constants
"local-member-names.rkt")
(import [prefix drracket:frame: drracket:frame^]
@ -87,5 +89,29 @@
(define (goto-plt-license)
(send-main-page #:sub "license/index.html"))
(define (maybe-try-to-materialize-docs)
;; under mac os x, the basic installation is put into a 'com.apple.quarantine'
;; which has the strange effect of making osascript drop the query parameters
;; for urls when they are sent to the browser. To work around this,
;; we materialize the documentation indicies in a user-specific place the
;; first time someone tries to read the docs with a specific query
;; the 'drracket:tried-materialize-user-docs pref is initialized to #t
;; on non-mac os x platforms so that we don't try at all there.
(unless (preferences:get 'drracket:tried-materialize-user-docs)
(preferences:set 'drracket:tried-materialize-user-docs #t)
(define sp (open-output-string))
(define succeeded? #t)
(materialize-user-docs (λ (go)
(set! succeeded? #f)
(parameterize ([current-output-port sp]
[current-error-port sp])
(set! succeeded? (go)))))
(unless succeeded?
(message-box (string-constant drracket)
(string-append
"Attempting to materialize user docs failed:\n\n"
(get-output-string sp))))))
(define (help-desk [key #f] [context #f])
(when key (maybe-try-to-materialize-docs))
(if key (perform-search key context) (send-main-page)))

View File

@ -75,6 +75,10 @@
(application:current-app-name (string-constant drscheme))
(preferences:set-default 'drracket:tried-materialize-user-docs
(not (equal? (system-type) 'macosx))
boolean?)
(preferences:set-default 'drracket:open-module-path-last-used "" string?)
(preferences:set-default 'drracket:logger-receiver-string "error debug@GC debug@PLaneT" string?)