removed current-print from the language dialog

svn: r10027
This commit is contained in:
Robby Findler 2008-05-30 02:08:59 +00:00
parent 0d81c599bd
commit d40b191eb7
4 changed files with 16 additions and 22 deletions

View File

@ -154,7 +154,7 @@
(= (vector-length printable) (= (vector-length printable)
(procedure-arity make-simple-settings)) (procedure-arity make-simple-settings))
(boolean? (vector-ref printable 0)) (boolean? (vector-ref printable 0))
(memq (vector-ref printable 1) '(constructor quasiquote write current-print)) (memq (vector-ref printable 1) '(constructor quasiquote write))
(memq (vector-ref printable 2) (memq (vector-ref printable 2)
'(mixed-fraction '(mixed-fraction
mixed-fraction-e mixed-fraction-e
@ -191,7 +191,7 @@
insert-newlines insert-newlines
annotations)) annotations))
;; case-sensitive : boolean ;; case-sensitive : boolean
;; printing-style : (union 'write 'constructor 'quasiquote 'current-print) ;; printing-style : (union 'write 'constructor 'quasiquote)
;; fraction-style : (union 'mixed-fraction 'mixed-fraction-e 'repeating-decimal 'repeating-decimal-e) ;; fraction-style : (union 'mixed-fraction 'mixed-fraction-e 'repeating-decimal 'repeating-decimal-e)
;; show-sharing : boolean ;; show-sharing : boolean
;; insert-newlines : boolean ;; insert-newlines : boolean
@ -236,8 +236,7 @@
(string-constant output-style-label) (string-constant output-style-label)
(list (string-constant constructor-printing-style) (list (string-constant constructor-printing-style)
(string-constant quasiquote-printing-style) (string-constant quasiquote-printing-style)
(string-constant write-printing-style) (string-constant write-printing-style))
(string-constant print-printing-style))
output-panel output-panel
(λ (rb evt) (λ (rb evt)
(let ([on? (not (= (send rb get-selection) 3))]) (let ([on? (not (= (send rb get-selection) 3))])
@ -264,8 +263,7 @@
(case (send output-style get-selection) (case (send output-style get-selection)
[(0) 'constructor] [(0) 'constructor]
[(1) 'quasiquote] [(1) 'quasiquote]
[(2) 'write] [(2) 'write])
[(3) 'current-print])
(if (send fraction-style get-value) (if (send fraction-style get-value)
'repeating-decimal-e 'repeating-decimal-e
'mixed-fraction-e) 'mixed-fraction-e)
@ -282,12 +280,7 @@
(case (simple-settings-printing-style settings) (case (simple-settings-printing-style settings)
[(constructor) 0] [(constructor) 0]
[(quasiquote) 1] [(quasiquote) 1]
[(write) 2] [(write) 2]))
[(current-print) 3]))
(let ([on? (not (eq? 'current-print (simple-settings-printing-style settings)))])
(send fraction-style enable on?)
(send show-sharing enable on?)
(send insert-newlines enable on?))
(send fraction-style set-value (eq? (simple-settings-fraction-style settings) (send fraction-style set-value (eq? (simple-settings-fraction-style settings)
'repeating-decimal-e)) 'repeating-decimal-e))
(send show-sharing set-value (simple-settings-show-sharing settings)) (send show-sharing set-value (simple-settings-show-sharing settings))
@ -301,9 +294,6 @@
;; simple-module-based-language-render-value/format : TST settings port (union #f (snip% -> void)) (union 'infinity number) -> void ;; simple-module-based-language-render-value/format : TST settings port (union #f (snip% -> void)) (union 'infinity number) -> void
(define (simple-module-based-language-render-value/format value settings port width) (define (simple-module-based-language-render-value/format value settings port width)
(if (eq? (simple-settings-printing-style settings) 'current-print)
(parameterize ([current-output-port port])
((current-print) value))
(let ([converted-value (simple-module-based-language-convert-value value settings)]) (let ([converted-value (simple-module-based-language-convert-value value settings)])
(setup-printing-parameters (setup-printing-parameters
(λ () (λ ()
@ -318,7 +308,7 @@
(pretty-print converted-value port)) (pretty-print converted-value port))
(newline port)])) (newline port)]))
settings settings
width)))) width)))
;; setup-printing-parameters : (-> void) simple-settings number -> void ;; setup-printing-parameters : (-> void) simple-settings number -> void
(define (setup-printing-parameters thunk settings width) (define (setup-printing-parameters thunk settings width)
@ -386,7 +376,6 @@
(define (simple-module-based-language-convert-value value settings) (define (simple-module-based-language-convert-value value settings)
(case (simple-settings-printing-style settings) (case (simple-settings-printing-style settings)
[(write) value] [(write) value]
[(current-print) value]
[(constructor) [(constructor)
(parameterize ([constructor-style-printing #t] (parameterize ([constructor-style-printing #t]
[show-sharing (simple-settings-show-sharing settings)] [show-sharing (simple-settings-show-sharing settings)]
@ -456,7 +445,6 @@
(define (convert-value value) (define (convert-value value)
,(case (simple-settings-printing-style setting) ,(case (simple-settings-printing-style setting)
[(write) `value] [(write) `value]
[(current-print) `value]
[(constructor) [(constructor)
`(parameterize ([constructor-style-printing #t] `(parameterize ([constructor-style-printing #t]
[show-sharing ,(simple-settings-show-sharing setting)]) [show-sharing ,(simple-settings-show-sharing setting)])

View File

@ -1402,8 +1402,7 @@ TODO
(current-value-port (get-value-port)) (current-value-port (get-value-port))
(current-input-port (get-in-box-port)) (current-input-port (get-in-box-port))
(current-print (lambda (v) (current-print (lambda (v) (display-results (list v)))))
(display-results (list v)))))
(define/private (initialize-dispatch-handler) ;;; =User= (define/private (initialize-dispatch-handler) ;;; =User=
(let* ([primitive-dispatch-handler (event-dispatch-handler)]) (let* ([primitive-dispatch-handler (event-dispatch-handler)])

View File

@ -1319,7 +1319,7 @@ all of the names in the tools library, for use defining keybindings
drscheme:language:simple-settings-printing-style drscheme:language:simple-settings-printing-style
(drscheme:language:simple-settings? (drscheme:language:simple-settings?
. -> . . -> .
(symbols 'constructor 'quasiquote 'write 'current-print)) (symbols 'constructor 'quasiquote 'write))
(simple-settings) (simple-settings)
@{Extracts the printing-style setting from a simple-settings.}) @{Extracts the printing-style setting from a simple-settings.})
@ -1373,7 +1373,7 @@ all of the names in the tools library, for use defining keybindings
(proc-doc/names (proc-doc/names
drscheme:language:make-simple-settings drscheme:language:make-simple-settings
(-> boolean? (-> boolean?
(symbols 'constructor 'quasiquote 'write 'current-print) (symbols 'constructor 'quasiquote 'write)
(symbols 'mixed-fraction 'mixed-fraction-e 'repeating-decimal 'repeating-decimal-e) (symbols 'mixed-fraction 'mixed-fraction-e 'repeating-decimal 'repeating-decimal-e)
boolean? boolean?
boolean? boolean?

View File

@ -22,6 +22,13 @@
the tools interface. Use drscheme:debug:error-display-handler/stacktrace the tools interface. Use drscheme:debug:error-display-handler/stacktrace
instead. instead.
. current-print's behavior is different in DrScheme. It
now prints to a separate port (the same on the REPL
printer uses, namely with blue output) and the style of
printing that it uses is controlled by the language
dialog (which means that the `current-print' option is
now gone from the language dialog)
------------------------------ ------------------------------
Version 372 Version 372
------------------------------ ------------------------------