[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Fri Jan 4 18:22:01 UTC 2013


Update of /project/slime/cvsroot/slime/contrib
In directory tiger.common-lisp.net:/tmp/cvs-serv1471

Modified Files:
	ChangeLog slime-fancy-inspector.el 
Log Message:
* slime-fancy-inspector.el (slime-edit-inspector-part): New
function, tries to find a definition of the part at point. Hooks
into `slime-edit-definition-hooks'.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2013/01/03 12:40:52	1.561
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2013/01/04 18:22:01	1.562
@@ -1,3 +1,9 @@
+2013-01-04  Stas Boukarev  <stassats at gmail.com>
+
+	* slime-fancy-inspector.el (slime-edit-inspector-part): New
+	function, tries to find a definition of the part at point. Hooks
+	into `slime-edit-definition-hooks'.
+
 2013-01-03  Stas Boukarev  <stassats at gmail.com>
 
 	* slime-cl-indent.el (define-common-lisp-style "basic"): Don't set
--- /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el	2010/07/23 01:41:27	1.8
+++ /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el	2013/01/04 18:22:01	1.9
@@ -4,7 +4,11 @@
   (:authors "Marco Baringer <mb at bese.it> and others")
   (:license "GPL")
   (:slime-dependencies slime-parse)
-  (:swank-dependencies swank-fancy-inspector))
+  (:swank-dependencies swank-fancy-inspector)
+  (:on-load
+   (add-hook 'slime-edit-definition-hooks 'slime-edit-inspector-part))
+  (:on-unload
+   (remove-hook 'slime-edit-definition-hooks 'slime-edit-inspector-part)))
 
 (defun slime-inspect-definition ()
   "Inspect definition at point"
@@ -17,4 +21,30 @@
   (slime-eval-describe `(swank:disassemble-form
                          ,(slime-definition-at-point t))))
 
+(let* ((id (slime-presentation-id presentation))
+       (presentation-string (format "Presentation %s" id))
+       (location (slime-eval `(swank:find-definition-for-thing
+                               (swank:lookup-presented-object
+                                ',(slime-presentation-id presentation))))))
+  (slime-edit-definition-cont
+   (and location (list (make-slime-xref :dspec `(,presentation-string)
+                                        :location location)))
+   presentation-string
+   where))
+
+(defun slime-edit-inspector-part (name &optional where)
+  (destructuring-bind (&optional property value)
+      (slime-inspector-property-at-point)
+    (when (eq property 'slime-part-number)
+      (let ((location (slime-eval `(swank:find-definition-for-thing
+                                    (swank:inspector-nth-part ,value))))
+            (name (format "Inspector part %s" value)))
+        (when (and (consp location)
+                   (not (eq (car location) :error)))
+          (slime-edit-definition-cont
+           (list (make-slime-xref :dspec `(,name)
+                                  :location location))
+           name
+           where))))))
+
 (provide 'slime-fancy-inspector)





More information about the slime-cvs mailing list