diff --git a/collects/drracket/private/interface.rkt b/collects/drracket/private/interface.rkt index d0772a0dab..eafa17386c 100644 --- a/collects/drracket/private/interface.rkt +++ b/collects/drracket/private/interface.rkt @@ -26,8 +26,7 @@ remain the same for tools that use them. (define unit:frame<%> (interface (frame:<%> frame:searchable-text<%> - frame:delegate<%> - frame:open-here<%>) + frame:delegate<%>) get-insert-menu get-special-menu get-interactions-text diff --git a/collects/drracket/private/unit.rkt b/collects/drracket/private/unit.rkt index 583ec63ab2..bffebbbaa3 100644 --- a/collects/drracket/private/unit.rkt +++ b/collects/drracket/private/unit.rkt @@ -1298,7 +1298,7 @@ module browser threading seems wrong. show-planet-status) (define frame-mixin - (mixin (drracket:frame:<%> frame:searchable-text<%> frame:delegate<%> frame:open-here<%>) + (mixin (drracket:frame:<%> frame:searchable-text<%> frame:delegate<%>) (drracket:unit:frame<%>) (init filename) (inherit set-label-prefix get-show-menu @@ -2717,7 +2717,6 @@ module browser threading seems wrong. (set! definitions-canvas (create-definitions-canvas)))) (define/override (get-delegated-text) definitions-text) - (define/override (get-open-here-editor) definitions-text) ;; wire the definitions text to the interactions text and initialize it. (define/private (init-definitions-text tab) @@ -4797,13 +4796,12 @@ module browser threading seems wrong. (frame:status-line-mixin (frame:info-mixin (frame:text-mixin - (frame:open-here-mixin - (frame:editor-mixin - (frame:standard-menus-mixin - (frame:register-group-mixin - (frame:focus-table-mixin - (frame:basic-mixin - frame%))))))))))))))))))) + (frame:editor-mixin + (frame:standard-menus-mixin + (frame:register-group-mixin + (frame:focus-table-mixin + (frame:basic-mixin + frame%)))))))))))))))))) (define-local-member-name enable-two-way-prefs) (define (make-two-way-prefs-dragable-panel% % pref-key) diff --git a/collects/framework/main.rkt b/collects/framework/main.rkt index 4352051fad..882b5e5f01 100644 --- a/collects/framework/main.rkt +++ b/collects/framework/main.rkt @@ -838,14 +838,7 @@ ((filename) ((make-default (λ () ((handler:current-create-new-window) filename))))) - @{This function creates a frame or re-uses an existing frame to edit a file. - - If the preference @racket['framework:open-here] is set to @racket[#t], and - @racket[(send (group:get-the-frame-group) get-open-here-frame)] returns a - frame, the @method[frame:open-here<%> open-here] method of that frame is - used to load the file in the existing frame. - - Otherwise, it invokes the appropriate format handler to open the file (see + @{This function invokes the appropriate format handler to open the file (see @racket[handler:insert-format-handler]). @itemize[ diff --git a/collects/framework/private/frame.rkt b/collects/framework/private/frame.rkt index 9930c009a1..f889d47250 100644 --- a/collects/framework/private/frame.rkt +++ b/collects/framework/private/frame.rkt @@ -1453,128 +1453,6 @@ ;; it might not yet be implemented (send canvas focus))))) -(define open-here<%> - (interface (-editor<%>) - get-open-here-editor - open-here)) - -(define open-here-mixin - (mixin (-editor<%>) (open-here<%>) - - (define/override (file-menu:new-on-demand item) - (super file-menu:new-on-demand item) - (send item set-label (if (preferences:get 'framework:open-here?) - (string-constant new-...-menu-item) - (string-constant new-menu-item)))) - - (define/override (file-menu:new-callback item event) - (cond - [(preferences:get 'framework:open-here?) - (let ([clear-current (ask-about-new-here)]) - (cond - [(eq? clear-current 'cancel) (void)] - [clear-current - (let* ([editor (get-editor)] - [canceled? (cancel-due-to-unsaved-changes editor)]) - (unless canceled? - (send editor begin-edit-sequence) - (send editor lock #f) - (send editor set-filename #f) - (send editor erase) - (send editor set-modified #f) - (send editor clear-undos) - (send editor end-edit-sequence)))] - [else ((handler:current-create-new-window) #f)]))] - [else ((handler:current-create-new-window) #f)])) - - ;; cancel-due-to-unsaved-changes : -> boolean - ;; returns #t if the action should be cancelled - (define/private (cancel-due-to-unsaved-changes editor) - (and (send editor is-modified?) - (let ([save (gui-utils:unsaved-warning - (let ([fn (send editor get-filename)]) - (if fn - (path->string fn) - (get-label))) - (string-constant clear-anyway) - #t - this)]) - (case save - [(continue) #f] - [(save) (not (send editor save-file/gui-error))] - [(cancel) #t])))) - - ;; ask-about-new-here : -> (union 'cancel boolean?) - ;; prompts the user about creating a new window - ;; or "reusing" the current one. - (define/private (ask-about-new-here) - (gui-utils:get-choice - (string-constant create-new-window-or-clear-current) - (string-constant clear-current) - (string-constant new-window) - (string-constant warning) - 'cancel - this)) - - (define/override (file-menu:open-on-demand item) - (super file-menu:open-on-demand item) - (send item set-label (if (preferences:get 'framework:open-here?) - (string-constant open-here-menu-item) - (string-constant open-menu-item)))) - - (define/augment (on-close) - (let ([group (group:get-the-frame-group)]) - (when (eq? this (send group get-open-here-frame)) - (send group set-open-here-frame #f))) - (inner (void) on-close)) - - (define/override (on-activate on?) - (super on-activate on?) - (when on? - (send (group:get-the-frame-group) set-open-here-frame this))) - - (inherit get-editor) - (define/public (get-open-here-editor) (get-editor)) - (define/public (open-here filename) - (let* ([editor (get-open-here-editor)] - [okay-to-switch? (user-okays-switch? editor)]) - (when okay-to-switch? - (when (is-a? editor text%) - (let* ([b (box #f)] - [filename (send editor get-filename b)]) - (unless (unbox b) - (when filename - (handler:set-recent-position - filename - (send editor get-start-position) - (send editor get-end-position)))))) - (send editor begin-edit-sequence) - (send editor lock #f) - (send editor load-file/gui-error filename) - (send editor end-edit-sequence) - (void)))) - - (inherit get-label) - (define/private (user-okays-switch? ed) - (or (not (send ed is-modified?)) - (let ([answer - (gui-utils:unsaved-warning - (let ([fn (send ed get-filename)]) - (if fn - (path->string fn) - (get-label))) - (string-constant switch-anyway) - #t)]) - (case answer - [(continue) - #t] - [(save) - (send ed save-file/gui-error)] - [(cancel) - #f])))) - - (super-new))) - (define text<%> (interface (-editor<%>))) (define text-mixin (mixin (-editor<%>) (text<%>) @@ -2738,10 +2616,9 @@ (define status-line% (status-line-mixin text-info%)) (define standard-menus% (standard-menus-mixin status-line%)) (define editor% (editor-mixin standard-menus%)) -(define open-here% (open-here-mixin editor%)) -(define -text% (text-mixin open-here%)) +(define -text% (text-mixin editor%)) (define searchable% (searchable-text-mixin (searchable-mixin -text%))) (define delegate% (delegate-mixin searchable%)) -(define -pasteboard% (pasteboard-mixin open-here%)) +(define -pasteboard% (pasteboard-mixin editor%)) diff --git a/collects/framework/private/group.rkt b/collects/framework/private/group.rkt index 1f9390a273..1bc409e9bb 100644 --- a/collects/framework/private/group.rkt +++ b/collects/framework/private/group.rkt @@ -162,19 +162,6 @@ (set-close-menu-item-state! a-frame #t)) frames)))) - (field [open-here-frame #f]) - (define/public (set-open-here-frame fr) (set! open-here-frame fr)) - (define/public (get-open-here-frame) - (cond - [open-here-frame open-here-frame] - [else - (let ([candidates - (filter (λ (x) (is-a? (frame-frame x) frame:open-here<%>)) - frames)]) - (if (null? candidates) - #f - (frame-frame (car candidates))))])) - (define/public (get-mdi-parent) (when (and (eq? (system-type) 'windows) (preferences:get 'framework:windows-mdi) diff --git a/collects/framework/private/handler.rkt b/collects/framework/private/handler.rkt index 8f49494b4c..5fb720f779 100644 --- a/collects/framework/private/handler.rkt +++ b/collects/framework/private/handler.rkt @@ -101,14 +101,6 @@ (send already-open make-visible filename) (send already-open show #t) already-open] - [(and (preferences:get 'framework:open-here?) - (send (group:get-the-frame-group) get-open-here-frame)) - => - (λ (fr) - (add-to-recent filename) - (send fr open-here filename) - (send fr show #t) - fr)] [else (let ([handler (and (path? filename) (find-format-handler filename))]) @@ -228,11 +220,7 @@ [end (caddr recent-list-item)]) (cond [(file-exists? filename) - (let ([fr (edit-file filename)]) - (when (is-a? fr frame:open-here<%>) - (let ([ed (send fr get-open-here-editor)]) - (when (equal? (send ed get-filename) filename) - (send ed set-position start end)))))] + (edit-file filename)] [else (preferences:set 'framework:recently-opened-files/pos (remove* (list recent-list-item) @@ -355,8 +343,7 @@ (super-instantiate ())))) (define (open-file [directory #f]) - (let* ([parent (and (or (not (eq? 'macosx (system-type))) - (preferences:get 'framework:open-here?)) + (let* ([parent (and (not (eq? 'macosx (system-type))) (get-top-level-focus-window))] [file (parameterize ([finder:dialog-parent-parameter parent]) diff --git a/collects/framework/private/main.rkt b/collects/framework/private/main.rkt index ba59746ee7..043978d16b 100644 --- a/collects/framework/private/main.rkt +++ b/collects/framework/private/main.rkt @@ -196,7 +196,6 @@ (λ (x) (or (eq? x 'age) (eq? x 'name)))) (preferences:set-default 'framework:recent-items-window-w 400 number?) (preferences:set-default 'framework:recent-items-window-h 600 number?) -(preferences:set-default 'framework:open-here? #f boolean?) (preferences:set-default 'framework:show-delegate? #f boolean?) (preferences:set-default 'framework:windows-mdi #f boolean?) (preferences:set-default 'framework:menu-bindings #t boolean?) diff --git a/collects/framework/private/preferences.rkt b/collects/framework/private/preferences.rkt index 0299970262..f50bd14e70 100644 --- a/collects/framework/private/preferences.rkt +++ b/collects/framework/private/preferences.rkt @@ -464,10 +464,6 @@ the state transitions / contracts are: 'framework:auto-set-wrap? (string-constant wrap-words-in-editor-buffers) values values) - (make-check editor-panel - 'framework:open-here? - (string-constant reuse-existing-frames) - values values) (make-check editor-panel 'framework:menu-bindings diff --git a/collects/framework/private/sig.rkt b/collects/framework/private/sig.rkt index aa76198d74..0abac09b1b 100644 --- a/collects/framework/private/sig.rkt +++ b/collects/framework/private/sig.rkt @@ -262,7 +262,6 @@ status-line<%> standard-menus<%> editor<%> - open-here<%> text<%> pasteboard<%> delegate<%> @@ -280,7 +279,6 @@ pasteboard-info% standard-menus% editor% - open-here% text% searchable% delegate% @@ -293,7 +291,6 @@ status-line-mixin standard-menus-mixin editor-mixin - open-here-mixin text-mixin pasteboard-mixin delegate-mixin diff --git a/collects/scribblings/framework/frame.scrbl b/collects/scribblings/framework/frame.scrbl index 1ffda924d5..faeb9acef3 100644 --- a/collects/scribblings/framework/frame.scrbl +++ b/collects/scribblings/framework/frame.scrbl @@ -683,61 +683,6 @@ } } -@definterface[frame:open-here<%> (frame:editor<%>)]{ - Frames implementing this mixin can change the file they are displaying. - - The frame is only re-used when the @racket['framework:open-here?] preference - is set (see @racket[preferences:get] and @racket[preferences:set] for details - on preferences). - - The @racket[frame:open-here-mixin] implements this interface. - - @defmethod*[(((get-open-here-editor) (is-a?/c editor<%>)))]{ - When the user switches the visible file in this frame, the of this method - is the editor that gets switched. - - By Default, returns the result of @method[frame:editor<%> get-editor]. - } - - @defmethod*[(((open-here (filename string)) void?))]{ - Opens @racket[filename] in the current frame, possibly prompting the user - about saving a file (in which case the frame might not get switched). - } - -} -@defmixin[frame:open-here-mixin (frame:editor<%>) (frame:open-here<%>)]{ - Provides an implementation of @racket[frame:open-here<%>] - - @defmethod*[#:mode override (((file-menu:new-on-demand (item (is-a?/c menu-item%))) void?))]{ - Sets the label of @racket[item] to @racket["New..."] if the preference - @racket['framework:open-here?] is set. - } - - @defmethod*[#:mode override (((file-menu:new-callback (item (is-a?/c menu-item%)) - (evt (is-a?/c control-event%))) - void?))]{ - When the preference @racket['framework:open-here?] preference is set, this - method prompts the user, asking if they would like to create a new frame, - or just clear out this one. If they clear it out and the file hasn't been - saved, they are asked about saving. - } - - @defmethod*[#:mode override (((file-menu:open-on-demand (item (is-a?/c menu-item%))) void?))]{ - Sets the label of @racket[item] to "Open Here..." if the preference - @racket['framework:open-here?] is set. - } - - @defmethod*[#:mode augment (((on-close) void?))]{ - Calls @method[group:% set-open-here-frame] with @racket[#f] if the result - of @method[group:% get-open-here-frame] is @racket[eq?] to @racket[this]. - } - - @defmethod*[#:mode override (((on-activate (on? boolean?)) void?))]{ - When @racket[on?] is @racket[#t], calls @method[group:% - set-open-here-frame] with @racket[this]. - } -} - @definterface[frame:text<%> (frame:editor<%>)]{ Frames matching this interface provide support for @racket[text%]s. } @@ -995,10 +940,9 @@ @defclass[frame:status-line% (frame:status-line-mixin frame:text-info%) ()]{} @defclass[frame:standard-menus% (frame:standard-menus-mixin frame:status-line%) ()]{} @defclass[frame:editor% (frame:editor-mixin frame:standard-menus%) ()]{} -@defclass[frame:open-here% (frame:open-here-mixin frame:editor%) ()]{} -@defclass[frame:text% (frame:text-mixin frame:open-here%) ()]{} +@defclass[frame:text% (frame:text-mixin frame:editor%) ()]{} @defclass[frame:searchable% (frame:searchable-text-mixin (frame:searchable-mixin frame:text%)) ()]{} @defclass[frame:delegate% (frame:delegate-mixin frame:searchable%) ()]{} -@defclass[frame:pasteboard% (frame:pasteboard-mixin frame:open-here%) ()]{} +@defclass[frame:pasteboard% (frame:pasteboard-mixin frame:editor%) ()]{} @(include-previously-extracted "main-extracts.rkt" #rx"^frame:") diff --git a/collects/scribblings/framework/group.scrbl b/collects/scribblings/framework/group.scrbl index 84cd1d6547..dc558578ae 100644 --- a/collects/scribblings/framework/group.scrbl +++ b/collects/scribblings/framework/group.scrbl @@ -11,15 +11,6 @@ constructed with @racket[frame:basic-mixin] adds itself to the result of @racket[group:get-the-frame-group]. - @defmethod*[(((set-open-here-frame (frame (is-a?/c frame:editor%))) void?))]{ - Sets the frame to load new files into. See also - @racket[frame:open-here<%>]. - } - - @defmethod*[(((get-open-here-frame) (or/c false/c (is-a?/c frame:editor<%>))))]{ - Returns the currently saved frame to load new files into. - } - @defmethod*[(((get-mdi-parent) (or/c false/c (is-a?/c frame%))))]{ The result of this method must be used as the parent frame for each frame in the group. diff --git a/collects/string-constants/private/danish-string-constants.rkt b/collects/string-constants/private/danish-string-constants.rkt index 109667187e..342eb03c7d 100644 --- a/collects/string-constants/private/danish-string-constants.rkt +++ b/collects/string-constants/private/danish-string-constants.rkt @@ -556,7 +556,6 @@ please adhere to these guidelines: (open-info "Åbn en fil fra disk") (open-menu-item "&Åbn...") - (open-here-menu-item "&Åbn her...") (open-recent-info "En liste af filer brugt for nylig") (open-recent-menu-item "Åbn gammel") diff --git a/collects/string-constants/private/dutch-string-constants.rkt b/collects/string-constants/private/dutch-string-constants.rkt index 87a4890b0d..567631385d 100644 --- a/collects/string-constants/private/dutch-string-constants.rkt +++ b/collects/string-constants/private/dutch-string-constants.rkt @@ -353,7 +353,6 @@ (open-info "Open bestand van schijf") (open-menu-item "&Open...") - (open-here-menu-item "&Open Hier...") (open-recent-info "Onlangs geopende bestanden") (open-recent-menu-item "Open opnieuw") diff --git a/collects/string-constants/private/english-string-constants.rkt b/collects/string-constants/private/english-string-constants.rkt index 3c85b24fb9..9d03f9bdc4 100644 --- a/collects/string-constants/private/english-string-constants.rkt +++ b/collects/string-constants/private/english-string-constants.rkt @@ -667,7 +667,6 @@ please adhere to these guidelines: (open-info "Open a file from disk") (open-menu-item "&Open...") - (open-here-menu-item "&Open Here...") (open-recent-info "A list of the recently opened files") (open-recent-menu-item "Open Recen&t") diff --git a/collects/string-constants/private/french-string-constants.rkt b/collects/string-constants/private/french-string-constants.rkt index 5040a53ea7..6ad0fac2be 100644 --- a/collects/string-constants/private/french-string-constants.rkt +++ b/collects/string-constants/private/french-string-constants.rkt @@ -628,7 +628,6 @@ (open-info "Ouvrir un fichier à partir du disque dur.") (open-menu-item "&Ouvrir") - (open-here-menu-item "&Ouvrir ici...") (open-recent-info "Une liste des fichiers ouverts récemment.") (open-recent-menu-item "Ouvrir récen&t") diff --git a/collects/string-constants/private/german-string-constants.rkt b/collects/string-constants/private/german-string-constants.rkt index 36d5569b7f..ccc15542dd 100644 --- a/collects/string-constants/private/german-string-constants.rkt +++ b/collects/string-constants/private/german-string-constants.rkt @@ -556,7 +556,6 @@ (open-info "Datei öffnen") (open-menu-item "&Öffnen...") - (open-here-menu-item "Hier &öffnen...") (open-recent-info "Liste kürzlich bearbeiteter Dateien") (open-recent-menu-item "Noch einmal öffnen") diff --git a/collects/string-constants/private/japanese-string-constants.rkt b/collects/string-constants/private/japanese-string-constants.rkt index f8f64a66ec..8712add4f4 100644 --- a/collects/string-constants/private/japanese-string-constants.rkt +++ b/collects/string-constants/private/japanese-string-constants.rkt @@ -604,7 +604,6 @@ please adhere to these guidelines: (open-info "ディスクからファイルを開きます") (open-menu-item "開く(&O)...") - (open-here-menu-item "ここに開く(&O)...") (open-recent-info "最近開いたファイルの一覧を表示します") (open-recent-menu-item "最近開いたファイル") diff --git a/collects/string-constants/private/korean-string-constants.rkt b/collects/string-constants/private/korean-string-constants.rkt index 333f6f2d96..ba06c65c25 100644 --- a/collects/string-constants/private/korean-string-constants.rkt +++ b/collects/string-constants/private/korean-string-constants.rkt @@ -534,7 +534,6 @@ (open-info "디스크에서 파일 가져와서 열기") (open-menu-item "열기 (&O)") - (open-here-menu-item "여기에 열기 (&O)") (open-recent-info "최근 열어본 파일 목록") (open-recent-menu-item "최근 파일 열기 (&T)") diff --git a/collects/string-constants/private/portuguese-string-constants.rkt b/collects/string-constants/private/portuguese-string-constants.rkt index 3b8b0c2692..e6a6a46826 100644 --- a/collects/string-constants/private/portuguese-string-constants.rkt +++ b/collects/string-constants/private/portuguese-string-constants.rkt @@ -557,7 +557,6 @@ please adhere to these guidelines: (open-info "Abrir ficheiro do disco") (open-menu-item "&Abrir...") - (open-here-menu-item "&Abrir aqui...") (open-recent-info "A lista dos ficheiros abertos mais recentes") (open-recent-menu-item "Abrir Recente") diff --git a/collects/string-constants/private/russian-string-constants.rkt b/collects/string-constants/private/russian-string-constants.rkt index 32c4067ee0..5301f5cbe8 100644 --- a/collects/string-constants/private/russian-string-constants.rkt +++ b/collects/string-constants/private/russian-string-constants.rkt @@ -609,7 +609,6 @@ please adhere to these guidelines: (open-info "Открыть файл с диска") (open-menu-item "&Открыть...") - (open-here-menu-item "&Открыть здесь...") (open-recent-info "Список последних открытых файлов") (open-recent-menu-item "Открыть &последние") diff --git a/collects/string-constants/private/simplified-chinese-string-constants.rkt b/collects/string-constants/private/simplified-chinese-string-constants.rkt index e16d2dc653..f81b9244ce 100644 --- a/collects/string-constants/private/simplified-chinese-string-constants.rkt +++ b/collects/string-constants/private/simplified-chinese-string-constants.rkt @@ -521,7 +521,6 @@ (open-info "打开现有文件") (open-menu-item "打开(&O)...") - (open-here-menu-item "从这里打开(&O)...") (open-recent-info "最近使用过文件的列表") (open-recent-menu-item "最近使用过的文件(&T)") diff --git a/collects/string-constants/private/spanish-string-constants.rkt b/collects/string-constants/private/spanish-string-constants.rkt index 88178fbd6f..088117114f 100644 --- a/collects/string-constants/private/spanish-string-constants.rkt +++ b/collects/string-constants/private/spanish-string-constants.rkt @@ -448,7 +448,6 @@ (open-info "Abre un nuevo archivo del disco") (open-menu-item "&Abrir...") - (open-here-menu-item "&Abrir aquí...") (open-recent-info "Una lista de archivos abiertos recientemente") (open-recent-menu-item "Abrir reciente") diff --git a/collects/string-constants/private/traditional-chinese-string-constants.rkt b/collects/string-constants/private/traditional-chinese-string-constants.rkt index b84412f9f9..ebb4b2db12 100644 --- a/collects/string-constants/private/traditional-chinese-string-constants.rkt +++ b/collects/string-constants/private/traditional-chinese-string-constants.rkt @@ -520,7 +520,6 @@ (open-info "打开现有文件") (open-menu-item "打开(&O)...") - (open-here-menu-item "从这里打开(&O)...") (open-recent-info "最近使用过文件的列表") (open-recent-menu-item "最近使用过的文件(&T)") diff --git a/collects/string-constants/private/ukrainian-string-constants.rkt b/collects/string-constants/private/ukrainian-string-constants.rkt index c3bcef4cae..2bd2247caf 100644 --- a/collects/string-constants/private/ukrainian-string-constants.rkt +++ b/collects/string-constants/private/ukrainian-string-constants.rkt @@ -609,7 +609,6 @@ please adhere to these guidelines: (open-info "Відкрити файл з диску") (open-menu-item "&Відкрити...") - (open-here-menu-item "&Відкрити тут...") (open-recent-info "Список останніх відкритих файлів") (open-recent-menu-item "Відкрити о&станні") diff --git a/doc/release-notes/drracket/HISTORY.txt b/doc/release-notes/drracket/HISTORY.txt index 31c6656f26..00b4fec1e9 100644 --- a/doc/release-notes/drracket/HISTORY.txt +++ b/doc/release-notes/drracket/HISTORY.txt @@ -12,6 +12,9 @@ . added online expansion and check syntax + . removed the "open here" functionality (both from + the DrRacket app and from the framework library) + . 2htdp/image: - shrunk the size of saved files that contain 2htdp/image bitmaps (you can get these by copying and pasting from the REPL; using