diff --git a/collects/stepper/private/model.ss b/collects/stepper/private/model.ss index fb91862591..199db817f0 100644 --- a/collects/stepper/private/model.ss +++ b/collects/stepper/private/model.ss @@ -361,11 +361,12 @@ (define-struct skipped-step ()) (define the-skipped-step (make-skipped-step)) -;; produce a posn-info structure based on the information in a mark-list +;; produce a posn-info structure or false based on the information in a mark-list +;; mark-list->posn-info : (listof mark) -> (or/c posn-info? false?) (define (mark-list->posn-info mark-list) (let* ([first-mark-source (mark-source (car mark-list))] [posn (syntax-position first-mark-source)] [span (syntax-span first-mark-source)]) - (unless posn - (error 'mark-list->posn-info "expected a syntax object with a syntax-position, got: ~v" (syntax->datum first-mark-source))) - (make-posn-info posn span))) + (if posn + (make-posn-info posn span) + #f))) diff --git a/collects/stepper/view-controller.ss b/collects/stepper/view-controller.ss index 2a34f097e5..f44e990a39 100644 --- a/collects/stepper/view-controller.ss +++ b/collects/stepper/view-controller.ss @@ -68,7 +68,7 @@ ;; possible values: #f, or a predicate on steps. (define stepper-is-waiting? (lambda (x) #t)) - ;; hand-off-and-block : (-> text%? boolean? void?) + ;; hand-off-and-block : (-> text%? any (listof (or/c posn-info? false?)) void?) ;; hand-off-and-block generates a new semaphore, hands off a thunk to ;; drscheme's eventspace, and blocks on the new semaphore. The thunk ;; adds the text% to the waiting queue, and checks to see if the @@ -194,7 +194,8 @@ (begin ;; each step has its own semaphore, so releasing one twice is ;; no problem. - (semaphore-post release-for-next-step) + (when release-for-next-step + (semaphore-post release-for-next-step)) (when stepper-is-waiting? (error 'try-to-get-view "try-to-get-view should not be reachable when already waiting for new step")) @@ -327,7 +328,9 @@ ;; en/dis-able-buttons : set enable & disable the stepper buttons, ;; based on view-controller state (define (en/dis-able-buttons) - (let* ([can-go-back? (and view (> view 0))]) + ;; let's just leave all the buttons enabled... + (void) + #;(let* ([can-go-back? (and view (> view 0))]) (send previous-button enable can-go-back?) (send previous-application-button enable can-go-back?) (send next-button