Re: [Sbcl-devel] Supported interfaces for Lisp introspection (arglist, find-definition etc)

Ingvar <[email protected]> Fri, 10 Oct 2003 16:26:37 +0100
Newsgroups gmane.lisp.ilisp.devel,gmane.lisp.steel-bank.devel
Message-ID <[email protected]>
Dan Barlow writes: 
> The idea I had on the way back from lunch was to have SBCL convert
> form offsets into character positions, then in Emacs set markers in
> those places when the file is first visited.  We'd then treat
> character positions passed back from find-definition-source calls
> as opaque cookies that map to the markers on each form.
> 
> I don't do a lot of elisp, though, and the manual warns that using
> lots of markers in a file may slow down editing; I don't know if the
> slowdown is likely to be visible on modern machines or if that warning
> has been there forever: I can't see any intrinsic reason that it
> should be slower than, say, editing a file with text properties.  Even
> if it is, maybe we could fake it with invisible text properties
> instead.  Elisp hackers?

One thing I do for my C editing is to include (for each function) a rather big 
comment with invisible text properties around and suitable stickiness, so I 
can have a comment-editing minor mode that automagically gets switched on and 
off as needed. this doesn't noticeably slow down editing and I imagine a text 
property with (say) list-introspection-form-number can be created, containing 
a form offset as its only content (this so one can do some sort of binary 
search through the buffer to find the right form, instead of a linear search).

I also seem to be adding a bunch of other text properties (start and end of 
comment, as a marker), without much ill effect. Admittedly, I seem to split 
files down to about 30-40 functions per file, so...

head$ grep '^ [*] Func:' wf-engine.c | wc -l
     34


//Ingvar





-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php