summaryrefslogtreecommitdiff
blob: 2a1cfae165451ab34484f32357039a8a7ddab02c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff -Naur slime.old/contrib/slime-presentations.el slime/contrib/slime-presentations.el
--- slime.old/contrib/slime-presentations.el	2007-10-28 22:21:39.000000000 +0100
+++ slime/contrib/slime-presentations.el	2007-10-28 22:22:31.000000000 +0100
@@ -44,6 +44,15 @@
 (make-variable-buffer-local
  (defvar slime-presentation-start-to-point (make-hash-table)))
 
+(setq slime-inspector-value-provider
+      (lambda ()
+        (multiple-value-bind (presentation start end)
+            (slime-presentation-around-point (point))
+          (when presentation
+            ;; Point is within a presentation, so don't prompt, just 
+            ;; inspect the presented object; don't play DWIM.
+            (slime-presentation-expression presentation)))))
+
 (defun slime-mark-presentation-start (id &optional target)
   "Mark the beginning of a presentation with the given ID.
 TARGET can be nil (regular process output) or :repl-result."
diff -Naur slime.old/slime.el slime/slime.el
--- slime.old/slime.el	2007-10-28 22:21:38.000000000 +0100
+++ slime/slime.el	2007-10-28 22:22:31.000000000 +0100
@@ -7454,11 +7454,15 @@
 (defvar slime-inspector-mark-stack '())
 (defvar slime-saved-window-config)
 
+(defvar slime-inspector-value-provider nil)
+
 (defun slime-inspect (string)
   "Eval an expression and inspect the result."
   (interactive 
-   (list (slime-read-from-minibuffer "Inspect value (evaluated): "
-				     (slime-sexp-at-point))))
+   (list (or (and slime-inspector-value-provider
+                  (funcall slime-inspector-value-provider))
+             (slime-read-from-minibuffer "Inspect value (evaluated): "
+                                         (slime-sexp-at-point)))))
   (slime-eval-async `(swank:init-inspector ,string) 'slime-open-inspector))
 
 (define-derived-mode slime-inspector-mode fundamental-mode "Slime-Inspector"