I finally had some time to dedicate to this. You are right there are<br>problems under Windows. Try this: on DrScheme, on Windows XP, open the<br>same file twice. Instead of reusing the already opened frame DrScheme<br>opens a new frame each time. The problem lies in the definition of
<br>`pathname-equal?' in unit.ss which is used to determine if the loaded<br>file in the tab is the same one we are trying to open. Here is the<br>code:<br><br> (define/private (pathname-equal? p1 p2)<br> (with-handlers ([exn:fail:filesystem? (lambda (x) #f)])
<br> (string=? (path->string (normalize-path p1))<br> (path->string (normalize-path p2)))))<br><br>The issue is the case insensitive comparison. On Windows case is not<br>significant for file names. The buffer name retrieved from the frame
<br>is always downcased while the one freshly retrieved from the file<br>system is not. So we have false negatives. Ironically the docs for<br>`normalize-path' warn against this exact problem:<br><br>"Letter case is not normalized by normalize-path. For this and other
<br> reasons, the result of normalize-path is not suitable for comparisons<br> that determine whether two paths refer to the same file (i.e., the<br> comparison may produce false negatives)."<br><br>Normalizing the case seems to take care of the problem:
<br><br> (define/private (pathname-equal? p1 p2)<br> (with-handlers ([exn:fail:filesystem? (? (x) #f)])<br> (string=? (path->string (normal-case-path (normalize-path p1)))<br> (path->string (normal-case-path (normalize-path p2))))))
<br><br>-pp<br><br><div><span class="gmail_quote">On 10/8/06, <b class="gmail_sendername">Robby Findler</b> <<a href="mailto:robby@cs.uchicago.edu">robby@cs.uchicago.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
handler:edit-file should just bring the appropriate frame/tab to the<br>front when the file is already open for editing. There have been<br>problems with path comparisons in the past, however (especially with<br>some of the strange things that can happen under windows). Maybe you're
<br>running into that?<br><br>If you want to see, try adding some printouts in the locate-file method<br>in group.ss.<br><br>Robby<br><br>At Sat, 7 Oct 2006 21:39:08 -0500, "pedro pinto" wrote:<br>> handler:edit-file seems to either always open a new frame or always load the
<br>> file in the current frame depending on the user preferences. What I want is<br>> to bring to the front the frame that has the file already loaded. Is there a<br>> way do to that?<br>><br>> TIA,<br>> -pp
<br>><br>><br>><br>> On 10/4/06, Robby Findler <<a href="mailto:robby@cs.uchicago.edu">robby@cs.uchicago.edu</a>> wrote:<br>><br>> [...]<br>><br>> To actually bring a different file to be editing, use handler:edit-file.
<br></blockquote></div><br>