diff --git a/collects/framework/frame.ss b/collects/framework/frame.ss index 65daf238..21245738 100644 --- a/collects/framework/frame.ss +++ b/collects/framework/frame.ss @@ -71,10 +71,12 @@ (override [can-close? (lambda () - (and (super-can-close?) - (send (group:get-the-frame-group) - can-remove-frame? - this)))] + (let ([super (super-can-close?)] + [group + (send (group:get-the-frame-group) + can-remove-frame? + this)]) + (and super group)))] [on-close (lambda () (super-on-close) @@ -85,7 +87,11 @@ (lambda (on?) (super-on-focus on?) (when on? - (send (group:get-the-frame-group) set-active-frame this)))]) + (send (group:get-the-frame-group) set-active-frame this)))] + + [on-drop-file + (lambda (filename) + (handler:edit-file filename))]) (inherit show) (public @@ -100,6 +106,7 @@ (on-close) (show #f)))]) + (inherit accept-drop-files) (sequence (let ([mdi-parent (send (group:get-the-frame-group) get-mdi-parent)]) (super-init label @@ -110,6 +117,8 @@ [mdi-parent (cons 'mdi-child style)] [else style]))) + (accept-drop-files #t) + (make-object menu% "Windows" (make-object (get-menu-bar%) this)) (reorder-menus this) (send (group:get-the-frame-group) insert-frame this)) diff --git a/collects/framework/group.ss b/collects/framework/group.ss index a385df60..44ec055e 100644 --- a/collects/framework/group.ss +++ b/collects/framework/group.ss @@ -157,7 +157,7 @@ f frames (lambda (f fr) (eq? f (frame-frame fr))))]) (if (null? new-frames) - (empty-test) + (empty-test) #t)))] [remove-frame (opt-lambda (f) diff --git a/collects/framework/scheme.ss b/collects/framework/scheme.ss index 9b4677af..aabf02f1 100644 --- a/collects/framework/scheme.ss +++ b/collects/framework/scheme.ss @@ -395,8 +395,7 @@ [visual-offset (lambda (pos) (let loop ([p (sub1 pos)]) - (if (= p -1) - 0 + (if p (let ([c (get-character p)]) (cond [(char=? c #\null) 0] @@ -404,7 +403,8 @@ (let ([o (loop (sub1 p))]) (+ o (- 8 (modulo o 8))))] [(char=? c #\newline) 0] - [else (add1 (loop (sub1 p)))])))))] + [else (add1 (loop (sub1 p)))])) + 0)))] [do-indent (lambda (amt) (let* ([pos-start end] @@ -645,11 +645,17 @@ exp-pos))]) (if (and exp-pos (> exp-pos 0)) - (let ([pos (apply max - (map paren-pos (scheme-paren:get-paren-pairs)))]) - (if (= pos -1) ;; all finds failed + (let ([poss (let loop ([parens (scheme-paren:get-paren-pairs)]) + (cond + [(null? parens) null] + [else + (let ([pos (paren-pos (car parens))]) + (if pos + (cons pos (loop (cdr parens))) + (loop (cdr parens))))]))]) + (if (null? poss) ;; all finds failed #f - (- pos 1))) ;; subtract one to move outside the paren + (- (apply max poss) 1))) ;; subtract one to move outside the paren #f)))] [up-sexp (lambda (start-pos)