[racket-dev] "bookmarks" in drracket?

From: Stephen Chang (stchang at ccs.neu.edu)
Date: Fri Feb 3 02:06:41 EST 2012

When using Dr Racket, I use the right-click "Jump to definition of" a
lot but I frequently find that I also want an easy way to get back to
the code I was previously looking at. Does anyone else think this
would be a useful feature to have? I've implemented something that
adds this functionality.

If anyone wants to try it out, I've included both modified source
files (from drracket/private) and a patch.

With the code I added, a "bookmark" automatically gets saved when
jumping to a definition from the right-click menu and when choosing a
definition from the "(define ...)" menu. Multiple bookmarks accumulate
on a stack. You can also add your own bookmarks with the right click
menu.

To go back to the most recent bookmark, either use the right-click
menu, or press C-x r (is this an appropriate key binding? I chose it
because emacs similarly uses C-x r to do bookmark-related stuff).

Since I'm not very familiar with drracket code, I'm not sure I put
stuff in the right place. Would anyone mind reviewing my code? It's
only a few lines.

Also, would something like this be better as a plugin in the future?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bookmarks.rkt
Type: application/octet-stream
Size: 1070 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120203/b3e3d80f/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rep.rkt
Type: application/octet-stream
Size: 92695 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120203/b3e3d80f/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unit.rkt
Type: application/octet-stream
Size: 235244 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120203/b3e3d80f/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bookmarks.patch
Type: application/octet-stream
Size: 6452 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120203/b3e3d80f/attachment-0007.obj>

Posted on the dev mailing list.