[slime-devel] Patch: slime-inspector-previous-inspectable-object

Matthias Koeppe mkoeppe+slime at mail.math.uni-magdeburg.de
Tue Jan 11 20:44:24 UTC 2005


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

> I installed the patch.  

Thanks, Helmut.  I am sending below another patch that improves the
inspector. 

Matthias

2005-01-11  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>

	* slime.el (slime-inspector-operate-on-click): New command for
	inspecting the value value at the clicked-at position or invoking
	an inspector action.
	(slime-inspector-mode-map): Bind it to mouse-2.
	(slime-inspector-insert-ispec): Add mouse-face properties for
	clickable values and action buttons.

Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.444
diff -u -p -r1.444 slime.el
--- slime.el	10 Jan 2005 19:32:00 -0000	1.444
+++ slime.el	11 Jan 2005 20:17:44 -0000
@@ -6826,10 +6836,12 @@ Optionally set point to POINT."
     (destructure-case ispec
       ((:value string id)
        (slime-insert-propertized (list 'slime-part-number id 
+                                       'mouse-face 'highlight
                                        'face 'slime-inspector-value-face)
                                  string))
       ((:action string id)
        (slime-insert-propertized (list 'slime-action-number id
+                                       'mouse-face 'highlight
                                        'face 'slime-inspector-action-face)
                                  string)))))
 
@@ -6849,6 +6861,19 @@ Optionally set point to POINT."
                                (lambda (parts)
                                  (slime-open-inspector parts point))))))))
 
+(defun slime-inspector-operate-on-click (event)
+  "Inspect the value at the clicked-at position or invoke an action."
+  (interactive "@e")
+  (let ((point (posn-point (event-end event))))
+    (cond
+     ((and point
+           (or (get-text-property point 'slime-part-number)
+               (get-text-property point 'slime-action-number)))
+      (goto-char point)
+      (slime-inspector-operate-on-point))
+     (t
+      (error "No clickable part here")))))          
+
 (defun slime-inspector-copy-down (number)
   "Evaluate the slot at point via the REPL (to set `*')."
   (interactive (list (or (get-text-property (point) 'slime-part-number)
@@ -6945,6 +6970,7 @@ If ARG is negative, move forwards."
   ([return] 'slime-inspector-operate-on-point)
   ([(meta return)] 'slime-inspector-copy-down)
   ("\C-m"   'slime-inspector-operate-on-point)
+  ([mouse-2] 'slime-inspector-operate-on-click)
   ("l" 'slime-inspector-pop)
   ("n" 'slime-inspector-next)
   (" " 'slime-inspector-next)



-- 
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe



More information about the slime-devel mailing list