[slime-devel] Re: Finding source of functions compiled with slime-compile-defun.

Peter Seibel peter at javamonkey.com
Sun Aug 8 22:16:43 UTC 2004


Helmut Eller <e9626484 at stud3.tuwien.ac.at> writes:

> Peter Seibel <peter at 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.

-Peter


Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.388
diff -u -r1.388 slime.el
--- slime.el	5 Aug 2004 15:18:32 -0000	1.388
+++ slime.el	8 Aug 2004 22:16:27 -0000
@@ -3096,7 +3096,7 @@
 
 (defun slime-compile-string (string start-offset)
   (slime-eval-async 
-   `(swank:compile-string-for-emacs ,string ,(buffer-name) ,start-offset)
+   `(swank:compile-string-for-emacs ,string ,(or (buffer-file-name) (buffer-name)) ,start-offset)
    (slime-compilation-finished-continuation)))
 
 (defvar slime-hide-style-warning-count-if-zero t)
Index: swank-allegro.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-allegro.lisp,v
retrieving revision 1.49
diff -u -r1.49 swank-allegro.lisp
--- swank-allegro.lisp	4 Aug 2004 17:17:55 -0000	1.49
+++ swank-allegro.lisp	8 Aug 2004 22:16:27 -0000
@@ -252,7 +252,7 @@
                `(in-package ,(package-name *package*))
                `(eval-when (:compile-toplevel :load-toplevel)
                  (setq excl::*source-pathname*
-                  (format nil "~A:~D" ',buffer ',position)))
+                  (format nil "~A" ',buffer)))
                string)))))
 
 ;;;; Definition Finding


-- 
Peter Seibel                                      peter at javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp





More information about the slime-devel mailing list