From 728153bb07aa258ebc0c9671134ef2c90a1b4d85 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 16 Oct 2011 17:38:50 -0500 Subject: [PATCH] adjust the code that checks to see if a file is in the module language so that it uses read-language, in the case that the simpler check (that just looks for "#lang") fails. please include in 5.2 (cherry picked from commit abf722f19ac5268616826ca4c461d71c13b790b9) --- collects/drracket/private/auto-language.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/drracket/private/auto-language.rkt b/collects/drracket/private/auto-language.rkt index 44ec5a5d5e..86d69776a6 100644 --- a/collects/drracket/private/auto-language.rkt +++ b/collects/drracket/private/auto-language.rkt @@ -58,7 +58,11 @@ (: looks-like-module? ((Instance Text%) -> Boolean)) (define (looks-like-module? text) (or (looks-like-new-module-style? text) - (looks-like-old-module-style? text))) + (looks-like-old-module-style? text) + (with-handlers ((exn:fail? (λ (x) #f))) + (procedure? + (read-language (open-input-text-editor text 0 'end (λ (x) x) text #f) + (λ () #f)))))) (: looks-like-old-module-style? ((Instance Text%) -> Boolean)) (define (looks-like-old-module-style? text)