[plt-scheme] obtaining list of opened files in DrScheme

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Wed Oct 4 19:02:29 EDT 2006

> I posted about this issue some months ago. I want to extend DrScheme
> with a change buffer dialog.  Guillaume Marceau was kind enough to
> point me to some example code [1], which seems to indicate that I have
> to transverse some objects, beginning at the editor<%> argument that
> is passed to my event handler, until I find someone that has the list
> of open files. Unfortunately, I don't know my way around the framework
> very well. Can anyone point me in the right direction?

Hi Pedro,

If you are trying to get the list of recently opened files, then that 
particular list seems to live as a "preferences" value.

(require (lib "framework.ss" "framework"))
(printf (preferences:get 'framework:recently-opened-files/pos))

But if you are trying to capture a list of all open files for a particular 
DrScheme that's running, I'm not so sure yet; I'm going to have to think 
about that one some more.

Offhand, if the functionality doesn't already exist, it can be patched in. 
One way to do it, without going through the menu structure, would be to 
have a tool hook their own mixin class for any particular unit window, so 
that one could trigger behavior whenever someone opens or closes a file. 
I'll try to cook up some example code for this if I have time.

Best of wishes!

Posted on the users mailing list.