Peter Seibel peter@javamonkey.com writes:
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
Peter Seibel peter@javamonkey.com writes:
Again, having not looked into it in any great detail, is there any way to communicate source location back to Lisp so it can find the source of functions compiled with C-c C-c?
excl::*source-pathname* seems to be the right place for Allegro CL. I committed some code to set this variable when compiling with C-c C-c.
So I finally got around to checking out this change. Looks good except I still get warnings from Allegro about redefining a function when I use C-c C-c after, say C-c C-k. Poking around a bit it seems that the problem is the location gets set differently by COMPILE-FILE and your code. The patch below makes two changes--when the buffer we are compiling from is a file buffer we pass the full filename rather than just the buffer name and we take of the character position. It seems to work with Allegro 6.2 but I don't know if there's some other reason that the buffer passed to swank:compile-string-for-emacs should be just the buffer name. If not I'd like to commit this.
Currently excl::*source-pathname* is being used in a hacky way to record the buffer and position that a definition was C-cC-c'd in, so that M-. can later extract/parse this information by way of find-fspec-location. Thus the "<buffername>:<position>" format is significant because it gets parsed back.
So your patch would muffle the warning at the expense of breaking M-. since it records only filename rather than buffer and position.
Seems to me the ideal would be to find a different way to record the source location instead of encoding it into the "pathname" string. Failing that perhaps another kludge is needed to muffle this warning..
-Luke