[slime-devel] slime-inspect doesn't work on presentations any more
Stelian Ionescu
sionescu at common-lisp.net
Wed Oct 3 23:06:46 UTC 2007
On Thu, Sep 20, 2007 at 05:09:39PM +0200, Helmut Eller wrote:
>* Stelian Ionescu [2007-09-17 00:33+0200] writes:
>
>> The attached patch makes SLIME-INSPECT work on presentations again. The
>> code is a cleanup of the first half of slime-inspect before the split.
>
>I'd rather like to add new command to slime-presentations.el instead
>of adding the slime-inspector-value-provider variable and making
>slime-inspect so complicated.
I don't think it's very complicated, and before the split SLIME-INSPECT
was much larger yet ISTR that nobody complained about it
I've attached two patches: the first one is a cleanup of my previous
patch which makes SLIME-INSPECT a little easier to customise and doesn't
enable the new inspect function automatically(I can add a defcustom if
needed).
However, if you still don't like that approach there's the second patch
which only adds the function SLIME-PRESENTATION-INSPECT. I don't think
this is better because it basically duplicates SLIME-INSPECT, but I don't
know how else to do it. Any suggestion ?
--
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
-------------- next part --------------
Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.875
diff -u -u -r1.875 slime.el
--- slime.el 27 Sep 2007 12:56:40 -0000 1.875
+++ slime.el 3 Oct 2007 22:43:26 -0000
@@ -7454,11 +7454,15 @@
(defvar slime-inspector-mark-stack '())
(defvar slime-saved-window-config)
+(defvar slime-inspect-function 'slime-basic-inspect)
+
+(defun slime-basic-inspect ()
+ (list (slime-read-from-minibuffer "Inspect value (evaluated): "
+ (slime-sexp-at-point))))
+
(defun slime-inspect (string)
"Eval an expression and inspect the result."
- (interactive
- (list (slime-read-from-minibuffer "Inspect value (evaluated): "
- (slime-sexp-at-point))))
+ (interactive (funcall slime-inspect-function))
(slime-eval-async `(swank:init-inspector ,string) 'slime-open-inspector))
(define-derived-mode slime-inspector-mode fundamental-mode "Slime-Inspector"
Index: contrib/slime-presentations.el
===================================================================
RCS file: /project/slime/cvsroot/slime/contrib/slime-presentations.el,v
retrieving revision 1.8
diff -u -u -r1.8 slime-presentations.el
--- contrib/slime-presentations.el 20 Sep 2007 14:55:53 -0000 1.8
+++ contrib/slime-presentations.el 3 Oct 2007 22:43:28 -0000
@@ -44,6 +44,14 @@
(make-variable-buffer-local
(defvar slime-presentation-start-to-point (make-hash-table)))
+(defun slime-presentation-inspect ()
+ (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."
-------------- next part --------------
Index: contrib/slime-presentations.el
===================================================================
RCS file: /project/slime/cvsroot/slime/contrib/slime-presentations.el,v
retrieving revision 1.8
diff -u -u -r1.8 slime-presentations.el
--- contrib/slime-presentations.el 20 Sep 2007 14:55:53 -0000 1.8
+++ contrib/slime-presentations.el 3 Oct 2007 22:52:05 -0000
@@ -44,6 +44,18 @@
(make-variable-buffer-local
(defvar slime-presentation-start-to-point (make-hash-table)))
+(defun slime-presentation-inspect ()
+ (interactive
+ (list (or (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)))
+ (slime-read-from-minibuffer "Inspect value (evaluated): "
+ (slime-sexp-at-point)))))
+ (slime-eval-async `(swank:init-inspector ,string) 'slime-open-inspector))
+
(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."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20071004/ee713bb0/attachment.sig>
More information about the slime-devel
mailing list