[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Fri Dec 14 08:46:49 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv10128

Modified Files:
	slime.el 
Log Message:

* slime.el (slime-insert-xref-location): New function. Tries to
  either insert the file name a function is defined in, or inserts
  information about the buffer a function was interactively 
  `C-c C-c'd from. Idea from Knut Olav Bøhmer.
  (slime-insert-xrefs): Use it.


--- /project/slime/cvsroot/slime/slime.el	2007/12/13 15:09:47	1.885
+++ /project/slime/cvsroot/slime/slime.el	2007/12/14 08:46:49	1.886
@@ -6078,15 +6078,23 @@
                  (list 'slime-location location
                        'face 'font-lock-keyword-face)
                  "  " (slime-one-line-ify label))
-             do (insert " - " (if (and (eql :location (car location))
-                                       (assoc :file (cdr location)))
-                                  (second (assoc :file (cdr location)))
-                                  "file unknown")
-                          "\n"))))
+             do (insert " - " (slime-insert-xref-location location) "\n"))))
   ;; Remove the final newline to prevent accidental window-scrolling
   (backward-char 1)
   (delete-char 1))
 
+(defun slime-insert-xref-location (location)
+  (if (eql :location (car location))
+      (cond ((assoc :file (cdr location)) 
+             (second (assoc :file (cdr location))))
+            ((assoc :buffer (cdr location))
+             (let* ((name (second (assoc :buffer (cdr location))))
+                    (buffer (get-buffer name)))
+               (if buffer 
+                   (format "%S" buffer)
+                   (format "%s (previously existing buffer)" name)))))
+      "file unknown"))
+
 (defvar slime-next-location-function nil
   "Function to call for going to the next location.")
 




More information about the slime-cvs mailing list