diff --git a/collects/drscheme/private/main.ss b/collects/drscheme/private/main.ss index df7d8c5c8b..8aae53466e 100644 --- a/collects/drscheme/private/main.ss +++ b/collects/drscheme/private/main.ss @@ -247,23 +247,31 @@ (drscheme:unit:open-drscheme-window filename))]) drscheme-current-create-new-window)) + ;; add a catch-all handler to open drscheme files + (handler:insert-format-handler + "Units" + (λ (filename) #t) + drscheme:unit:open-drscheme-window) + ;; add a handler to open .plt files. (handler:insert-format-handler "PLT Files" (λ (filename) - (and (equal? "plt" (filename-extension filename)) - (gui-utils:get-choice - (format (string-constant install-plt-file) filename) - (string-constant install-plt-file/yes) - (string-constant install-plt-file/no)))) + (let ([ext (filename-extension filename)]) + (and ext + (or (bytes=? #"PLT" ext) + (bytes=? #"plt" ext)) + (gui-utils:get-choice + (format (string-constant install-plt-file) filename) + (string-constant install-plt-file/yes) + (string-constant install-plt-file/no))))) (λ (filename) (run-installer filename) #f)) (drscheme:tools:load/invoke-all-tools - (λ () - (void)) - (λ () + (λ () (void)) + (λ () (drscheme:language-configuration:add-built-in-languages) (drscheme:module-language:add-module-language) (drscheme:language-configuration:add-info-specified-languages))) diff --git a/collects/drscheme/private/unit.ss b/collects/drscheme/private/unit.ss index 6fb8e15279..4c5d37a8f5 100644 --- a/collects/drscheme/private/unit.ss +++ b/collects/drscheme/private/unit.ss @@ -3072,9 +3072,4 @@ module browser threading seems wrong. [frame (new drs-frame% (filename filename))]) (send (send frame get-interactions-text) initialize-console) (send frame show #t) - frame)) - - (handler:insert-format-handler - "Units" - (λ (filename) #t) - open-drscheme-window)))) + frame))))) diff --git a/collects/framework/framework.ss b/collects/framework/framework.ss index c042d5ac23..0d8b5c469f 100644 --- a/collects/framework/framework.ss +++ b/collects/framework/framework.ss @@ -722,7 +722,9 @@ ". If \\var{pred} is a list of strings, they are each matched with the extension of a filename by" "@flink handler:find-format-handler %" ". If it is a function, the filename is applied to the function and the" - "functions result determines if this is the handler to use.") + "functions result determines if this is the handler to use." + "" + "The most recently added format handler takes precedence over all other format handlers.") (handler:find-named-format-handler (string? . -> . (path? . -> . (is-a?/c frame:editor<%>))) (name)