From 2c94de20aaf22a18e33b609b2c06fbfc5f6b5f6e Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 17 Jun 2008 17:25:30 +0000 Subject: [PATCH] hack: use a special value with exit to avoid popup message (no need for it now) svn: r10317 --- collects/drscheme/private/module-language.ss | 3 ++- collects/drscheme/private/rep.ss | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/collects/drscheme/private/module-language.ss b/collects/drscheme/private/module-language.ss index 11a41822b3..a92ceb457d 100644 --- a/collects/drscheme/private/module-language.ss +++ b/collects/drscheme/private/module-language.ss @@ -220,7 +220,8 @@ (queue-callback (λ () (fprintf (current-error-port) "\n(Further interactions disabled.)\n") - (kill-thread t))) + ;; special value that will exit the repl but avoid the popup + (exit "NO NEED TO POPUP A TERMINATION EXPLANATION"))) (apply raise-syntax-error '|Module Language| (if (null? error-args) (list (string-append diff --git a/collects/drscheme/private/rep.ss b/collects/drscheme/private/rep.ss index 1ce0cd1677..10f63cc30e 100644 --- a/collects/drscheme/private/rep.ss +++ b/collects/drscheme/private/rep.ss @@ -902,13 +902,18 @@ TODO (end-edit-sequence)) (field (already-warned? #f)) - + + ;; special value that is used with `exit' when we don't want the popup + (define no-terminate-explanation-string + "NO NEED TO POPUP A TERMINATION EXPLANATION") + (define/private (cleanup) (set! in-evaluation? #f) (update-running #f) (unless (and (get-user-thread) (thread-running? (get-user-thread))) (lock #t) - (unless shutting-down? + (unless (or shutting-down? + (equal? user-exit-code no-terminate-explanation-string)) (no-user-evaluation-message (let ([canvas (get-active-canvas)]) (and canvas @@ -916,7 +921,7 @@ TODO user-exit-code (not (thread-running? memory-killed-thread)))))) (field (need-interaction-cleanup? #f)) - + (define/private (no-user-evaluation-message frame exit-code memory-killed?) (let* ([new-limit (and custodian-limit (+ (* 1024 1024 128) custodian-limit))] [ans (message-box/custom @@ -1226,9 +1231,9 @@ TODO (parameterize ([current-eventspace drs-eventspace]) (queue-callback (λ () - (set! user-exit-code - (if (and (integer? x) - (<= 0 x 255)) + (set! user-exit-code + (if (or (and (integer? x) (<= 0 x 255)) + (equal? x no-terminate-explanation-string)) x 0)) (semaphore-post s)))) @@ -1832,4 +1837,4 @@ TODO (drs-autocomplete-mixin (λ (txt) (send txt get-definitions-text)) (text:foreground-color-mixin - text:clever-file-format%))))))))))))) \ No newline at end of file + text:clever-file-format%)))))))))))))