Comment 1 for bug 675913

Revision history for this message
Robert P. Goldman (rpgoldman) wrote : Re: extensible source-locations

I believe that this is the sort of thing for which TCR has been developing the EDITOR-HINTS library. The notion is to provide a portable way for the Common Lisp to signal useful information to the editor (SLIME).

Allegro CL has a source-recording facility that handles macros. IIRC there are two pieces to the facility:

1. Somewhere in the expansion of your macro you call a function that records source-file information. So you might extract one or more significant names, and record the source files for them. The source-file recording function takes a separate key, like the way DOCUMENTATION does in CL, but you can extend the set of keys.

2. You also define a way to map from your macro to the name (or names) it defines. E.g., simple macros might just extract the second element of the defining form as the name; more complicated macros would have a more complicated mapping function. The editor, when looking for a definition for FOO, first uses the source file recording to find the right file, then can grovel over the file, and use this "extractor" function to pull symbols out of s-expressions to find the right textual position.

Seems like sinking effort into a portable mechanism like this would be a big win.