[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Sun Feb 13 05:46:21 UTC 2011


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

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (slime-inspector-operate-on-point): Don't save the
point when inspecting a different object.
(slime-inspector-operate-on-point): If there is no action property
directly at the point, try looking at (1- (point)), many
inspectable objects are presented the end of the line, so it's
easier to navigate to them by C-e and still being able to activate
it.


--- /project/slime/cvsroot/slime/ChangeLog	2011/02/13 05:30:45	1.2178
+++ /project/slime/cvsroot/slime/ChangeLog	2011/02/13 05:46:21	1.2179
@@ -2,6 +2,11 @@
 
 	* slime.el (slime-inspector-operate-on-point): Don't save the
 	point when inspecting a different object.
+	(slime-inspector-operate-on-point): If there is no action property
+	directly at the point, try looking at (1- (point)), many
+	inspectable objects are presented the end of the line, so it's
+	easier to navigate to them by C-e and still being able to activate
+	it.
 
 2011-02-08  Stas Boukarev  <stassats at gmail.com>
 
--- /project/slime/cvsroot/slime/slime.el	2011/02/13 05:30:45	1.1357
+++ /project/slime/cvsroot/slime/slime.el	2011/02/13 05:46:21	1.1358
@@ -6525,6 +6525,17 @@
     (cons (line-number-at-pos)
           (current-column))))
 
+(defun slime-inspector-property-at-point ()
+  (let ((properties '(slime-part-number slime-range-button
+                      slime-action-number)))
+    (flet ((find-property (point)
+             (loop for property in properties
+                   for value = (get-text-property point property)
+                   when value
+                   return (list property value))))
+      (or (find-property (point))
+          (find-property (1- (point)))))))
+
 (defun slime-inspector-operate-on-point ()
   "Invoke the command for the text at point.
 1. If point is on a value then recursivly call the inspector on
@@ -6532,26 +6543,26 @@
 2. If point is on an action then call that action.
 3. If point is on a range-button fetch and insert the range."
   (interactive)
-  (let ((part-number (get-text-property (point) 'slime-part-number))
-        (range-button (get-text-property (point) 'slime-range-button))
-        (action-number (get-text-property (point) 'slime-action-number))
-        (opener (lexical-let ((point (slime-inspector-position)))
+  (let ((opener (lexical-let ((point (slime-inspector-position)))
                   (lambda (parts)
                     (when parts
                       (slime-open-inspector parts point)))))
         (new-opener (lambda (parts)
                       (when parts
                         (slime-open-inspector parts)))))
-    (cond (part-number
-           (slime-eval-async `(swank:inspect-nth-part ,part-number)
-                             new-opener)
+    (destructuring-bind (property value)
+        (slime-inspector-property-at-point)
+        (case property
+          (slime-part-number
+           (slime-eval-async `(swank:inspect-nth-part ,value)
+                              new-opener)
            (push (slime-inspector-position) slime-inspector-mark-stack))
-          (range-button
-           (slime-inspector-fetch-more range-button))
-          (action-number 
-           (slime-eval-async `(swank::inspector-call-nth-action ,action-number)
-             opener))
-          (t (error "No object at point")))))
+          (slime-range-button
+           (slime-inspector-fetch-more value))
+          (slime-action-number 
+           (slime-eval-async `(swank::inspector-call-nth-action ,value)
+                             opener))
+          (t (error "No object at point"))))))
 
 (defun slime-inspector-operate-on-click (event)
   "Move to events' position and operate the part."





More information about the slime-cvs mailing list