[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Tue Mar 2 14:36:48 UTC 2010


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv28685

Modified Files:
	ChangeLog swank-sbcl.lisp 
Log Message:
* swank-sbcl.lisp (definition-source-for-emacs): Don't error when source
location doesn't contain form position, point emacs to the beginning of a source file
and if it's a function provide a snippet "(defun <name> ".


--- /project/slime/cvsroot/slime/ChangeLog	2010/03/02 12:40:42	1.2005
+++ /project/slime/cvsroot/slime/ChangeLog	2010/03/02 14:36:47	1.2006
@@ -1,5 +1,11 @@
 2010-03-02  Stas Boukarev  <stassats at gmail.com>
 
+	* swank-sbcl.lisp (definition-source-for-emacs): Don't error when source
+	location doesn't contain form position, point emacs to the beginning of a source file
+	and if it's a function provide a snippet "(defun <name> ".
+
+2010-03-02  Stas Boukarev  <stassats at gmail.com>
+
 	* slime.el (slime-compile-and-load-file): Accept C-u arguments for
 	compilation policy the same way as slime-compile-defun.
 
--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2010/03/02 12:38:07	1.268
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2010/03/02 14:36:48	1.269
@@ -728,6 +728,7 @@
       definition-source
     (cond ((getf plist :emacs-buffer) :buffer)
           ((and pathname (or form-path character-offset)) :file)
+          (pathname :file-without-position)
           (t :invalid))))
 
 (defun definition-source-for-emacs (definition-source type name)
@@ -764,6 +765,11 @@
                         ;; 0, buffer positions in Emacs start from 1.
                         `(:position ,(1+ pos))
                         `(:snippet ,snippet))))
+      (:file-without-position
+       (make-location `(:file ,(namestring (translate-logical-pathname pathname)))
+                      '(:position 1)
+                      (when (eql type :function)
+                        `(:snippet ,(format nil "(defun ~a " (symbol-name name))))))
       (:invalid
        (error "DEFINITION-SOURCE of ~A ~A did not contain ~
                meaningful information."





More information about the slime-cvs mailing list