don't continue after an error when scribbling via the 'scribble html'
and 'scribble pdf' buttons in the drracket frame. closes PR 12385
This commit is contained in:
parent
94373ea9f9
commit
3da3e17c47
|
@ -906,12 +906,11 @@ all of the names in the tools library, for use defining keybindings
|
||||||
|
|
||||||
(parameter-doc
|
(parameter-doc
|
||||||
drracket:rep:after-expression
|
drracket:rep:after-expression
|
||||||
(parameter/c (or/c #f any/c))
|
(parameter/c (or/c #f (-> void?)))
|
||||||
top-level-expression
|
top-level-expression
|
||||||
@{This parameter is used by @method[drracket:rep:text% evaluate-from-port].
|
@{This parameter is used by @method[drracket:rep:text% evaluate-from-port].
|
||||||
When it is something other than @racket[#f], then DrRacket passes it to
|
When it is a thunk, then DrRacket invokes the thunk on the user's thread
|
||||||
@racket[eval] as the last thing that it does on the user's thread (before
|
as the last thing it does (before cleaning up).})
|
||||||
cleaning up).})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,16 @@
|
||||||
[fn
|
[fn
|
||||||
(parameterize ([drracket:rep:after-expression
|
(parameterize ([drracket:rep:after-expression
|
||||||
(λ ()
|
(λ ()
|
||||||
|
(define doc (with-handlers ((exn:fail? (λ (x) #f))) (eval 'doc)))
|
||||||
|
;; if (eval 'doc) goes wrong, then we assume that's because of
|
||||||
|
;; an earlier failure, so we just don't do anything.
|
||||||
|
(when doc
|
||||||
(printf "scribble: loading xref\n")
|
(printf "scribble: loading xref\n")
|
||||||
(define xref ((dynamic-require 'setup/xref 'load-collections-xref)))
|
(define xref ((dynamic-require 'setup/xref 'load-collections-xref)))
|
||||||
(printf "scribble: rendering\n")
|
(printf "scribble: rendering\n")
|
||||||
(parameterize ([current-input-port (open-input-string "")])
|
(parameterize ([current-input-port (open-input-string "")])
|
||||||
((dynamic-require 'scribble/render 'render)
|
((dynamic-require 'scribble/render 'render)
|
||||||
(list (eval 'doc))
|
(list doc)
|
||||||
(list fn)
|
(list fn)
|
||||||
#:render-mixin (dynamic-require (if html?
|
#:render-mixin (dynamic-require (if html?
|
||||||
'scribble/html-render
|
'scribble/html-render
|
||||||
|
@ -47,7 +51,7 @@
|
||||||
(send-url/file (path-replace-suffix fn suffix))]
|
(send-url/file (path-replace-suffix fn suffix))]
|
||||||
[else
|
[else
|
||||||
(parameterize ([current-input-port (open-input-string "")])
|
(parameterize ([current-input-port (open-input-string "")])
|
||||||
(system (format "open \"~a\"" (path->string (path-replace-suffix fn suffix)))))]))])
|
(system (format "open \"~a\"" (path->string (path-replace-suffix fn suffix)))))])))])
|
||||||
(send drs-frame execute-callback))]
|
(send drs-frame execute-callback))]
|
||||||
[else
|
[else
|
||||||
(message-box "Scribble" "Cannot render buffer without filename")]))))
|
(message-box "Scribble" "Cannot render buffer without filename")]))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user