From ce32003de26450831511f73cf20201c78b6271f6 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 15 Jul 2011 14:29:13 -0400 Subject: [PATCH] Make Performance Report work on unsaved editors. --- collects/typed-scheme/optimizer/tool/report.rkt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/collects/typed-scheme/optimizer/tool/report.rkt b/collects/typed-scheme/optimizer/tool/report.rkt index 3f359b07cf..706664c55d 100644 --- a/collects/typed-scheme/optimizer/tool/report.rkt +++ b/collects/typed-scheme/optimizer/tool/report.rkt @@ -33,6 +33,9 @@ (define input (open-input-text-editor this)) (port-count-lines! input) (define log '()) + (define unsaved-file? + (and (symbol? portname) + (regexp-match #rx"^unsaved-editor" (symbol->string portname)))) (define good-portname-cache #f) (define (right-file? f) ; does the log-entry refer to the file we're in? (cond [(and good-portname-cache ; cache is populated @@ -42,6 +45,10 @@ [(send this port-name-matches? f) (set! good-portname-cache f) ; populate cache #t] + [unsaved-file? + ;; we assume that any log entry without a filename comes from + ;; the unsaved editor + (not f)] [else ; different file #f])) (with-intercepted-tr-logging