[slime-devel] Clicky things in the REPL.
lawrence mitchell
wence at gmx.li
Sun Dec 14 21:47:53 UTC 2003
Having used the clim listener, I wondered if it would be
possible to make things in the SLIME repl clicky in the same way
that they are there.
It turns out that this isn't too much of a problem, though the
regexp horror was almost too much. I present herewith a minimal
first example of use.
Probably only works in SBCL, since that's what the regexp has
been tested with, I don't know when the 'mouse-face text
property was introduced in Emacs (or if it even exists in
XEmacs), so, you might lose there, and I don't think
that the 'keymap text property works in XEmacs.
How it works:
When the repl receives some output, it gets passed through
SLIME-MAKE-CLICKY-THINGS, which looks for stuff of the form:
#<name something>
where something can have spaces in it. Then, depending on what
NAME is, the relevant bit of the output is propertized, and
inserted. Currently, it handles PACKAGE, FUNCTION, and
foo-CLASS, the last is assumed to be a class of some kind.
A local keymap is installed, which is accessible via mouse-3,
and allows you to do things like describe the thing, or see it's
documentation, etc...
This requires one minor patch to swank.lisp, defining a
DESCRIBE-PACKAGE function.
Index: swank.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank.lisp,v
retrieving revision 1.79
diff -u -r1.79 swank.lisp
--- swank.lisp 14 Dec 2003 07:52:31 -0000 1.79
+++ swank.lisp 14 Dec 2003 21:44:31 -0000
@@ -724,6 +724,10 @@
(print-description-to-string
(symbol-function (find-symbol-designator symbol-name))))
+(defslimefun describe-package (symbol-name)
+ (print-description-to-string
+ (find-package symbol-name)))
+
(defslimefun documentation-symbol (symbol-name &optional default)
(let ((*package* *buffer-package*))
(let ((vdoc (documentation (symbol-from-string symbol-name) 'variable))
And the file itself:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slime-clicky-things.el
Type: application/emacs-lisp
Size: 5560 bytes
Desc: Clicky things for slime
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20031214/50e9e793/attachment.bin>
-------------- next part --------------
--
lawrence mitchell <wence at gmx.li>
More information about the slime-devel
mailing list