editor and documentation repairs (merge to 4.2)

svn: r14864
This commit is contained in:
Matthew Flatt 2009-05-19 01:02:41 +00:00
parent 63a7a9c77b
commit 17a283a28d
11 changed files with 217 additions and 183 deletions

View File

@ -259,7 +259,8 @@ Matthew
(interactive? fit-on-page?)
(interactive? fit-on-page? output-mode)
(interactive? fit-on-page? output-mode parent)
(interactive? fit-on-page? output-mode parent force-ps-page-bbox?)]
(interactive? fit-on-page? output-mode parent force-ps-page-bbox?)
(interactive? fit-on-page? output-mode parent force-ps-page-bbox? as-eps?)]
unlocked)
(get-text [() (x) (x y) (x y z) (x y z p)] unlocked)

View File

@ -532,7 +532,9 @@
(if (and media
(or (positive? y)
scroll-bottom-based?))
(let ([v (- (send media scroll-line-location (+ y scroll-offset))
(let ([v (- (if (send media locked-for-read?)
0.0
(send media scroll-line-location (+ y scroll-offset)))
ymargin)])
(set-box! fy v)
(when (and scroll-bottom-based?

View File

@ -388,7 +388,7 @@
;; ----------------------------------------
(def/public (set-keymap [keymap% [k #f]])
(def/public (set-keymap [(make-or-false keymap%) [k #f]])
(set! s-keymap k))
(def/public (get-keymap) s-keymap)
(def/public (get-style-list) s-style-list)
@ -540,7 +540,7 @@
[box? data-buffer])
(set-box! data-buffer (send f tell))
(send f put-fixed 0)
(send f put-bytes (string->bytes/utf-8 header-name))
(send f put-unterminated (string->bytes/utf-8 header-name))
#t)
(def/public (end-write-header-footer-to-file [editor-stream-out% f]
@ -850,7 +850,7 @@
(values 0 size s naya))
;; no room to grow, so drop an undo record
(begin
(send c cancel)
(send (vector-ref c start) cancel)
(vector-set! c start #f)
(values (modulo (add1 start) size)
end

View File

@ -905,11 +905,12 @@ Debugging tools:
;; ------------------------------------------------------------
(define (update-flow mline root-box media max-width dc)
(define (update-flow mline root-box media max-width dc notify-delete notify-insert)
(define (flow-left)
(if (bit-overlap? (mline-flags mline) FLOW-LEFT)
(if (and (not (eq? (mline-left mline) NIL))
(update-flow (mline-left mline) root-box media max-width dc))
(update-flow (mline-left mline) root-box media max-width dc
notify-delete notify-insert))
#t
(begin
(set-mline-flags! mline (- (mline-flags mline) FLOW-LEFT))
@ -929,7 +930,8 @@ Debugging tools:
(define (flow-right)
(if (bit-overlap? (mline-flags mline) FLOW-RIGHT)
(if (and (not (eq? (mline-right mline) NIL))
(update-flow (mline-right mline) root-box media max-width dc))
(update-flow (mline-right mline) root-box media max-width dc
notify-delete notify-insert))
#t
(begin
(set-mline-flags! mline (- (mline-flags mline) FLOW-RIGHT))
@ -967,7 +969,9 @@ Debugging tools:
(set-mline-last-snip! newline (mline-last-snip mline))
(set-mline-last-snip! mline asnip)
(snips-to-line! newline))
(snips-to-line! newline)
(notify-insert newline))
;; just pushed to next line
(begin
(set-mline-last-snip! mline asnip)
@ -992,7 +996,10 @@ Debugging tools:
(if (and (mline-next mline)
(eq? asnip (mline-last-snip (mline-next mline))))
;; a line was deleted
(begin (delete (mline-next mline) root-box) #t)
(let ([next (mline-next mline)])
(delete next root-box)
(notify-delete next)
#t)
#f))
(define (do-extend-line asnip)
;; this line was extended
@ -1015,6 +1022,7 @@ Debugging tools:
(let ([next (mline-next mline)])
(when next
(delete next root-box)
(notify-delete delete)
(loop))))
#f))])

View File

@ -85,7 +85,6 @@
end-sequence-lock
check-flow
get-printing
is-printing?
do-begin-print
do-end-print
do-has-print-page?)
@ -96,6 +95,7 @@
get-s-last-snip
get-s-total-width
get-s-total-height
get-s-snips
refresh-box
add-back-clickback
do-insert-snips)

View File

@ -80,7 +80,9 @@
(let-boxes ([ok? #f]
[sl 0.0]
[st 0.0])
(set-box! ok? (send editor get-snip-location snip sl st #f))
(set-box! ok? (if (send editor locked-for-read?)
#f
(send editor get-snip-location snip sl st #f)))
(if ok?
(let-boxes ([sr 0.0][sb 0.0])
(send editor get-snip-location snip sr sb #t)

View File

@ -233,6 +233,7 @@
(define initial-space 0.0) ; space from first line
(define initial-line-base 0.0) ; inverse descent from first line
(define/public (get-s-snips) snips)
(define/public (get-s-last-snip) last-snip)
(define/public (get-s-total-width) total-width)
(define/public (get-s-total-height) total-height)
@ -593,6 +594,7 @@
(def/override (blink-caret)
(if s-caret-snip
(when s-admin
(let-boxes ([dx 0.0]
[dy 0.0]
[dc #f])
@ -600,7 +602,7 @@
(when dc
(let-boxes ([x 0.0] [y 0.0])
(get-snip-location s-caret-snip x y)
(send s-caret-snip blink-caret dc (- x dx) (- y dy)))))
(send s-caret-snip blink-caret dc (- x dx) (- y dy))))))
(if (too-busy-to-refresh?)
;; we're busy; go away
(void)
@ -1036,7 +1038,8 @@
;; - already at top
(let-boxes ([scroll-left 0.0] [vy 0.0]
[scroll-width 0.0] [scroll-height 0.0])
(send s-admin get-view scroll-left vy scroll-width scroll-height)
(when s-admin
(send s-admin get-view scroll-left vy scroll-width scroll-height))
;; top line should be completely visible as bottom line after
;; scrolling
(let* ([top (find-scroll-line vy)]
@ -1094,7 +1097,8 @@
(if (eq? 'page kind)
(let-boxes ([scroll-left 0.0] [vy 0.0]
[scroll-width 0.0] [scroll-height 0.0])
(send s-admin get-view scroll-left vy scroll-width scroll-height)
(when s-admin
(send s-admin get-view scroll-left vy scroll-width scroll-height))
;; last fully-visible line is the new top line
(let* ([newtop (find-scroll-line (+ vy scroll-height))]
[y (scroll-line-location (+ newtop 1))]
@ -2213,9 +2217,12 @@
(if read-locked?
#\nul
(let-values ([(snip s-pos) (find-snip/pos (max 0 (min start len)) 'after)])
(let ([delta (- start s-pos)])
(if (delta . >= . (snip->count snip))
#\nul
(let ([buffer (make-string 1)])
(send snip get-text! buffer (- start s-pos) 1 0)
(string-ref buffer 0)))))
(send snip get-text! buffer delta 1 0)
(string-ref buffer 0)))))))
;; ----------------------------------------
@ -2929,7 +2936,8 @@
(let ([dc (send s-admin get-dc)])
(let-boxes ([w 0.0]
[h 0.0])
(send thesnip get-extent dc (unbox x) (unbox y) w h #f #f #f #f)
(when dc
(send thesnip get-extent dc (unbox x) (unbox y) w h #f #f #f #f))
(set! write-locked? wl?)
(set! flow-locked? fl?)
@ -3054,7 +3062,8 @@
(let-boxes ([h 0.0]
[descent 0.0]
[space 0.0])
(send snip get-extent dc horiz topy #f h descent space #f #F)
(when dc
(send snip get-extent dc horiz topy #f h descent space #f #F))
(let ([align (send (snip->style snip) get-alignment)])
(cond
[(eq? 'bottom align)
@ -4561,7 +4570,17 @@
(let ([w (- max-width CURSOR-WIDTH)])
(let loop ([-changed? #f])
(if (mline-update-flow (unbox line-root-box) line-root-box this w dc)
(if (mline-update-flow (unbox line-root-box) line-root-box this w dc
(lambda (del-line)
(when (eq? del-line first-line)
(set! first-line (mline-first (unbox line-root-box))))
(when (eq? del-line last-line)
(set! last-line (mline-last (unbox line-root-box)))))
(lambda (ins-line)
(when (not (mline-prev ins-line))
(set! first-line ins-line))
(when (not (mline-next ins-line))
(set! last-line ins-line))))
(loop #t)
(begin

View File

@ -42,7 +42,9 @@
[(make-or-false (make-box exact-nonnegative-integer?)) startp]
[(make-or-false (make-box exact-nonnegative-integer?)) endp]
[(symbol-in caret line selection user1 user2) reason])
(with-method ([get-map ((send win get-wordbreak-map) get-map)])
(let ([wb (send win get-wordbreak-map)])
(when wb
(with-method ([get-map (wb get-map)])
(define (nonbreak? ch) (memq reason (get-map ch)))
(when startp
@ -150,4 +152,4 @@
(send win get-text lstart (+ lstart lend))
lend
end)
(set-box! endp (+ end lstart)))))))))))
(set-box! endp (+ end lstart)))))))))))))

View File

@ -734,7 +734,7 @@ See also @method[editor<%> set-load-overwrites-styles].
}
@defmethod[(get-max-height)
(or/c (and/c real? (not/c negative?)) (one/of 'none))]{
(or/c (and/c real? (not/c negative?)) 'none)]{
Gets the maximum display height for the contents of the editor; zero or
@scheme['none] indicates that there is no maximum.
@ -770,7 +770,7 @@ If the @techlink{display} is an editor canvas, see also
}
@defmethod[(get-max-width)
(or/c (and/c real? (not/c negative?)) (one/of 'none))]{
(or/c (and/c real? (not/c negative?)) 'none)]{
Gets the maximum display width for the contents of the editor; zero or
@scheme['none] indicates that there is no maximum. In a text editor,
@ -779,7 +779,7 @@ Gets the maximum display width for the contents of the editor; zero or
}
@defmethod[(get-min-height)
(or/c (and/c real? (not/c negative?)) (one/of 'none))]{
(or/c (and/c real? (not/c negative?)) 'none)]{
Gets the minimum display height for the contents of the editor; zero
or @scheme['none] indicates that there is no minimum.
@ -788,7 +788,7 @@ Gets the minimum display height for the contents of the editor; zero
@defmethod[(get-min-width)
(or/c (and/c real? (not/c negative?)) (one/of 'none))]{
(or/c (and/c real? (not/c negative?)) 'none)]{
Gets the minimum display width for the contents of the editor; zero or
@scheme['none] indicates that there is no minimum.
@ -945,7 +945,7 @@ inserts the resulting snip into the editor.
'text 'text-force-cr) 'guess]
[show-errors? any/c #t])
boolean?]
[(insert-file [port input-port]
[(insert-file [port input-port?]
[format (one-of/c 'guess 'same 'copy 'standard
'text 'text-force-cr) 'guess]
[show-errors? any/c #t])
@ -988,7 +988,7 @@ calling
}
@defmethod[(insert-port [port input-port]
@defmethod[(insert-port [port input-port?]
[format (one-of/c 'guess 'same 'copy 'standard
'text 'text-force-cr) 'guess]
[replace-styles? any/c #t])
@ -1014,8 +1014,8 @@ if @scheme[replace-styles?] is true, then styles in the current style
@defmethod[(invalidate-bitmap-cache [x real? 0.0]
[y real? 0.0]
[width (or/c (and/c real? (not/c negative?)) (one/of 'end)) 'end]
[height (or/c (and/c real? (not/c negative?)) (one/of 'end)) 'end])
[width (or/c (and/c real? (not/c negative?)) 'end) 'end]
[height (or/c (and/c real? (not/c negative?)) 'end) 'end])
void?]{
When @method[editor<%> on-paint] is overridden, call this method when
@ -1523,7 +1523,7 @@ Creates a @scheme[editor-snip%] with either a sub-editor from
}}
@defmethod[(on-new-image-snip [filename (or/c path? #f)]
@defmethod[(on-new-image-snip [filename path?]
[kind (one-of/c 'unknown 'gif 'jpeg 'xbm 'xpm 'bmp 'pict)]
[relative-path? any/c]
[inline? any/c])
@ -1713,7 +1713,7 @@ To extend or re-implement copying, override the @xmethod[text%
@defmethod[(print [interactive? any/c #t]
[fit-on-page? any/c #t]
[output-mode (one-of/c 'standard 'postscript) 'standard]
[parent (or/c (or/c @scheme[frame%] (is-a?/c dialog%)) #f) #f]
[parent (or/c (or/c (is-a?/c frame%) (is-a?/c dialog%)) #f) #f]
[force-ps-page-bbox? any/c #t]
[as-eps? any/c #f])
void?]{
@ -2003,7 +2003,7 @@ The @scheme[show-errors?] argument is no longer used.
}
@defmethod[(save-port [port output-port]
@defmethod[(save-port [port output-port?]
[format (one-of/c 'guess 'same 'copy 'standard
'text 'text-force-cr) 'same]
[show-errors? any/c #t])
@ -2044,7 +2044,7 @@ administrator, @scheme[#f] is returned.
}
@defmethod[(scroll-line-location [pos (and/c exact? integer?)])
@defmethod[(scroll-line-location [pos exact-nonnegative-integer?])
(and/c real? (not/c negative?))]{
Maps a vertical scroll position to a vertical @techlink{location}
@ -2226,7 +2226,7 @@ See also @method[editor<%> get-load-overwrites-styles] and
}
@defmethod[(set-max-height [width (or/c (and/c real? (not/c negative?)) (one/of 'none))])
@defmethod[(set-max-height [width (or/c (and/c real? (not/c negative?)) 'none)])
void?]{
Sets the maximum display height for the contents of the editor. A
@ -2238,7 +2238,7 @@ Setting the height is disallowed when the editor is internally locked
}
@defmethod[(set-max-undo-history [count (or/c exact-nonnegative-integer? (one/of 'forever))])
@defmethod[(set-max-undo-history [count (or/c exact-nonnegative-integer? 'forever)])
void?]{
Sets the maximum number of undoables that will be remembered by the
@ -2249,7 +2249,7 @@ Sets the maximum number of undoables that will be remembered by the
}
@defmethod[(set-max-width [width (or/c (and/c real? (not/c negative?)) (one/of 'none))])
@defmethod[(set-max-width [width (or/c (and/c real? (not/c negative?)) 'none)])
void?]{
Sets the maximum display width for the contents of the editor;
@ -2265,7 +2265,7 @@ See also @method[text% set-autowrap-bitmap].
}
@defmethod[(set-min-height [width (or/c (and/c real? (not/c negative?)) (one/of 'none))])
@defmethod[(set-min-height [width (or/c (and/c real? (not/c negative?)) 'none)])
void?]{
Sets the minimum display height for the contents of the editor; zero
@ -2276,7 +2276,7 @@ Setting the height is disallowed when the editor is internally locked
}
@defmethod[(set-min-width [width (or/c (and/c real? (not/c negative?)) (one/of 'none))])
@defmethod[(set-min-width [width (or/c (and/c real? (not/c negative?)) 'none)])
void?]{
Sets the minimum display width for the contents of the editor; zero or

View File

@ -325,13 +325,13 @@ See also @method[text% hide-caret].
@defmethod*[#:mode extend
([(change-style [delta (or/c (is-a?/c style-delta%) #f)]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'end)) 'end]
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'end) 'end]
[counts-as-mod? any/c #t])
void?]
[(change-style [style (or/c (is-a?/c style<%>) #f)]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'end)) 'end]
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'end) 'end]
[counts-as-mod? any/c #t])
void?])]{
@ -352,8 +352,8 @@ When @scheme[style] is provided: @InStyleListNote[@scheme[style]]
@defmethod[#:mode extend
(copy [extend? any/c #f]
[time (and/c exact? integer?) 0]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'end)) 'end])
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'end) 'end])
void?]{
Copies specified range of text into the clipboard. If @scheme[extend?] is
@ -383,8 +383,8 @@ In addition to the default @xmethod[editor<%> copy-self-to] work,
@defmethod[#:mode override
(cut [extend? any/c #f]
[time (and/c exact? integer?) 0]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'end)) 'end])
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'end) 'end])
void?]{
Copies and then deletes the specified range. If @scheme[extend?] is not
@ -399,8 +399,8 @@ See @|timediscuss| for a discussion of the @scheme[time] argument. If
}
@defmethod*[([(delete [start (or/c exact-nonnegative-integer? (one/of 'start))]
[end (or/c exact-nonnegative-integer? (one/of 'back)) 'back]
@defmethod*[([(delete [start (or/c exact-nonnegative-integer? 'start)]
[end (or/c exact-nonnegative-integer? 'back) 'back]
[scroll-ok? any/c #t])
void?]
[(delete)
@ -520,8 +520,8 @@ Given a @techlink{location} in the editor, returns the line at the
@defmethod[(find-newline [direction (one-of/c 'forward 'backward) 'forward]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'eof)) 'eof])
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'eof) 'eof])
(or/c exact-nonnegative-integer? #f)]{
Like @method[text% find-string], but specifically finds a paragraph
@ -623,8 +623,8 @@ can be any of the following:
@defmethod[(find-string [str string?]
[direction (one-of/c 'forward 'backward) 'forward]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'eof)) 'eof]
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'eof) 'eof]
[get-start? any/c #t]
[case-sensitive? any/c #t])
(or/c exact-nonnegative-integer? #f)]{
@ -655,8 +655,8 @@ If @scheme[case-sensitive?] is @scheme[#f], then an uppercase and lowercase
@defmethod[(find-string-all [str string?]
[direction (one-of/c 'forward 'backward) 'forward]
[start (or/c exact-nonnegative-integer? (one/of 'start)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'eof)) 'eof]
[start (or/c exact-nonnegative-integer? 'start) 'start]
[end (or/c exact-nonnegative-integer? 'eof) 'eof]
[get-start? any/c #t]
[case-sensitive any/c #t])
(listof exact-nonnegative-integer?)]{
@ -944,7 +944,7 @@ See also
@defmethod[(get-text [start exact-nonnegative-integer? 0]
[end (or/c exact-nonnegative-integer? (one/of 'eof)) 'eof]
[end (or/c exact-nonnegative-integer? 'eof) 'eof]
[flattened? any/c #f]
[force-cr? any/c #f])
string?]{
@ -1045,13 +1045,13 @@ See also @method[text% caret-hidden?] and @method[editor<%> lock].
@defmethod*[#:mode override
([(insert [str string?]
[start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[scroll-ok? any/c #t])
void?]
[(insert [n exact-nonnegative-integer?]
[str string?]
[start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[scroll-ok? any/c #t])
void?]
[(insert [str string?])
@ -1061,7 +1061,7 @@ See also @method[text% caret-hidden?] and @method[editor<%> lock].
void?]
[(insert [snip (is-a?/c snip%)]
[start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[scroll-ok? any/c #t])
void?]
[(insert [snip (is-a?/c snip%)])
@ -1070,7 +1070,7 @@ See also @method[text% caret-hidden?] and @method[editor<%> lock].
void?]
[(insert [char char?]
[start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same])
[end (or/c exact-nonnegative-integer? 'same) 'same])
void?])]{
Inserts text or a snip into @this-obj[] at @techlink{position}
@ -1562,8 +1562,8 @@ If the paragraph starts with invisible @techlink{item}s and @scheme[visible?] is
@defmethod[#:mode override
(paste [time (and/c exact? integer?) 0]
[start (or/c exact-nonnegative-integer? (one/of 'start 'end)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same])
[start (or/c exact-nonnegative-integer? 'start 'end) 'start]
[end (or/c exact-nonnegative-integer? 'same) 'same])
void?]{
Pastes into the specified range. If @scheme[start] is @scheme['start],
@ -1604,8 +1604,8 @@ If the previous operation on the editor was not a paste, calling
@defmethod[#:mode override
(paste-x-selection [time (and/c exact? integer?)]
[start (or/c exact-nonnegative-integer? (one/of 'start 'end)) 'start]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same])
[start (or/c exact-nonnegative-integer? 'start 'end) 'start]
[end (or/c exact-nonnegative-integer? 'same) 'same])
void?]{
Pastes into the specified range. If @scheme[start] is @scheme['start],
@ -1697,7 +1697,7 @@ Returns the paragraph number of the paragraph containing a given @techlink{posit
@defmethod[#:mode extend
(read-from-file [stream (is-a?/c editor-stream-in%)]
[start (or/c exact-nonnegative-integer? (one/of 'start))]
[start (or/c exact-nonnegative-integer? 'start)]
[overwrite-styles? any/c #f])
boolean?]{
@ -1719,7 +1719,7 @@ Removes all clickbacks installed for exactly the range @scheme[start]
@defmethod[(scroll-to-position [start exact-nonnegative-integer?]
[at-eol? any/c #f]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[bias (one-of/c 'start 'end 'none) 'none])
boolean?]{
@ -1914,7 +1914,7 @@ The first line of the paragraph is indented by @scheme[first-left] points
@defmethod[(set-position [start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[at-eol? any/c #f]
[scroll? any/c #t]
[seltype (one-of/c 'default 'x 'local) 'default])
@ -1958,7 +1958,7 @@ See also @scheme[editor-set-x-selection-mode].
@defmethod[(set-position-bias-scroll [bias (one-of/c 'start-only 'start 'none 'end 'end-only)]
[start exact-nonnegative-integer?]
[end (or/c exact-nonnegative-integer? (one/of 'same)) 'same]
[end (or/c exact-nonnegative-integer? 'same) 'same]
[ateol? any/c #f]
[scroll? any/c #t]
[seltype (one-of/c 'default 'x 'local) 'default])
@ -2087,7 +2087,7 @@ Splitting a snip is disallowed when the editor is internally locked
@defmethod[#:mode extend
(write-to-file [stream (is-a?/c editor-stream-out%)]
[start exact-nonnegative-integer? 0]
[end (or/c exact-nonnegative-integer? (one/of 'eof)) 'eof])
[end (or/c exact-nonnegative-integer? 'eof) 'eof])
boolean?]{
If @scheme[start] is 0 and @scheme[end] is @scheme['eof] negative,

View File

@ -1,9 +1,9 @@
#lang scheme/gui
(define seed 700438844 #;(abs (current-milliseconds)))
(define seed (abs (current-milliseconds)))
(random-seed seed)
; scroll-line-location bug
(error-print-context-length 100)
(define orig-t (new text%))