[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Thu Dec 17 10:30:32 UTC 2009


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

Modified Files:
	swank-asdf.lisp slime-asdf.el ChangeLog 
Log Message:
	* slime.el (slime-edit-uses-xrefs): New variable. For contribs to
	extend.
	(slime-edit-uses): Use it.

	* swank.lisp (xref-doit): Now a generic functions. For contribs to
	extend.

	* swank-asdf.lisp (who-depends-on): Make defslimefun.
	(xref-doit [:depends-on]): New method to make :depends-on valid
	xref request.

	* slime-asdf.el (slime-who-depends-on-rpc): New.
	(slime-who-depends-on): New interactive function.
	(slime-asdf-init): Make `slime-edit-uses' perform a :depends-on
	request, and bind `C-c C-w d' to `slime-who-depends-on'.


--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/15 20:29:01	1.22
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/17 10:30:31	1.23
@@ -22,7 +22,7 @@
         do (funcall fn system)))
 
 ;;; This is probably a crude hack, see ASDF's LP #481187.
-(defun who-depends-on (system)
+(defslimefun who-depends-on (system)
   (flet ((system-dependencies (op system)
            (mapcar #'(lambda (dep)
                        (asdf::coerce-name (if (consp dep) (second dep) dep)))
@@ -37,6 +37,17 @@
              (push (asdf:component-name system) result))))
       result)))
 
+(defmethod xref-doit ((type (eql :depends-on)) thing)
+  (loop for dependency in (who-depends-on thing)
+        for asd-file = (asdf:system-definition-pathname dependency)
+        collect (list dependency
+                      (swank-backend::make-location
+                       `(:file ,(namestring asd-file))
+                       `(:position 1)
+                       `(:snippet ,(format nil "(defsystem :~A" dependency)
+                         :align t)))))
+
+
 (defslimefun operate-on-system-for-emacs (system-name operation &rest keywords)
   "Compile and load SYSTEM using ASDF.
 Record compiler notes signalled as `compiler-condition's."
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/15 17:12:41	1.22
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/17 10:30:31	1.23
@@ -68,6 +68,9 @@
   "Try to determine the asdf system that `filename' belongs to."
   (slime-eval `(swank:asdf-determine-system ,filename ,buffer-package)))
 
+(defun slime-who-depends-on-rpc (system)
+  (slime-eval `(swank:who-depends-on ,system)))
+
 (defun slime-oos (system operation &rest keyword-args)
   "Operate On System."
   (slime-save-some-lisp-buffers)
@@ -183,6 +186,10 @@
    `(swank:reload-system ,system)
    #'slime-compilation-finished))
 
+(defun slime-who-depends-on (system-name)
+  (interactive (list (slime-read-system-name)))
+  (slime-xref :depends-on system-name))
+
 
 ;;; REPL shortcuts
 
@@ -246,7 +253,9 @@
   (slime-eval-async '(swank:swank-require :swank-asdf)))
 
 (defun slime-asdf-init ()
-  (add-hook 'slime-connected-hook 'slime-asdf-on-connect))
+  (add-hook 'slime-connected-hook 'slime-asdf-on-connect)
+  (add-to-list 'slime-edit-uses-xrefs :depends-on t)
+  (define-key slime-who-map [?d] 'slime-who-depends-on))
 
 (defun slime-asdf-unload ()
   (remove-hook 'slime-connected-hook 'slime-asdf-on-connect))
--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/15 20:29:01	1.306
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/17 10:30:31	1.307
@@ -1,3 +1,14 @@
+2009-12-17  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* swank-asdf.lisp (who-depends-on): Make defslimefun.
+	(xref-doit [:depends-on]): New method to make :depends-on valid
+	xref request.
+
+	* slime-asdf.el (slime-who-depends-on-rpc): New.
+	(slime-who-depends-on): New interactive function.
+	(slime-asdf-init): Make `slime-edit-uses' perform a :depends-on
+	request, and bind `C-c C-w d' to `slime-who-depends-on'.
+
 2009-12-15  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* swank-asdf.lisp (who-depends-on): Add.





More information about the slime-cvs mailing list