Is there already a SLIME feature like a "Generic Function Browser"? If so can someone tell how to invoke it?
Here's what I'd expect from it: - list all methods of a generic function in a separate buffer - by navigating to a function and pressing 'r' it gets removed (like with REMOVE-METHOD) - 'q' closes the window - there might be some other nice things possible but this is what's be most important, cause every time I modify a method the old method is still there and it's awfully complicated to remove it then.
hope someone can help
-ts
Thomas Schilling writes:
Is there already a SLIME feature like a "Generic Function Browser"?
No, but it's not a big deal because there is the inspector. Well, except the inspector is missing a command to copy the object-at-point to the repl ... which reminds me, I have a patch to send in.
With this, you can do the following to remove a method:
#'some-gf
#<Generic-Function ...> C-c I * ... find the method you want ... M-RET
(remove-method ** *)
It would still be nice to have class- and gf-browsers, but with the addition of a copy-down command, the inspector is an okay stand-in for most any kind of browser.
- there might be some other nice things possible but this is what's be most
important, cause every time I modify a method the old method is still there and it's awfully complicated to remove it then.
I feel you here, the syntax of remove-method is, uh, not exactly user-friendly. This comes up for all kinds of data-driven code, so although it's not the perfect solution for methods, if your code looks like mine, it's more important to be able to generally maniuplate stuff from the inspector.
Index: ChangeLog =================================================================== RCS file: /project/slime/cvsroot/slime/ChangeLog,v retrieving revision 1.436 diff -u -r1.436 ChangeLog --- ChangeLog 28 Jun 2004 21:05:28 -0000 1.436 +++ ChangeLog 29 Jun 2004 07:04:40 -0000 @@ -1,3 +1,9 @@ +2004-06-28 Thomas F. Burdick tfb@OCF.Berkeley.EDU + * swank.lisp (inspector-nth-part): + * slime.el (slime-inspector-copy-down, slime-inspector-mode-map): + Added copy-down command (M-RET) to easily move an object from the + inspector to the repl. + 2004-06-28 Luke Gorrie luke@bluetail.com
* slime.el (slime-doc-map): New keymap for documentation @@ -212,6 +218,7 @@
* swank.lisp (prefixed-var): Intern *REAL-STANDARD-INPUT* etc in the SWANK package instead of the COMMON-LISP package. +>>>>>>> 1.436
2004-06-21 Luke Gorrie luke@bluetail.com
Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.343 diff -u -r1.343 slime.el --- slime.el 28 Jun 2004 21:05:16 -0000 1.343 +++ slime.el 29 Jun 2004 07:04:56 -0000 @@ -6197,6 +6197,11 @@ 'slime-open-inspector) (push (point) slime-inspector-mark-stack))
+(defun slime-inspector-copy-down (number) + (interactive (list (slime-inspector-object-at-point))) + (slime-repl-send-string (format "%s" `(swank:inspector-nth-part ,number))) + (slime-repl)) + (defun slime-inspector-pop () (interactive) (slime-eval-async @@ -6229,6 +6234,7 @@
(slime-define-keys slime-inspector-mode-map ([return] 'slime-inspector-inspect-object-at-point) + ([(meta return)] 'slime-inspector-copy-down) ("\C-m" 'slime-inspector-inspect-object-at-point) ("l" 'slime-inspector-pop) ("n" 'slime-inspector-next) Index: swank.lisp =================================================================== RCS file: /project/slime/cvsroot/slime/swank.lisp,v retrieving revision 1.204 diff -u -r1.204 swank.lisp --- swank.lisp 27 Jun 2004 14:58:51 -0000 1.204 +++ swank.lisp 29 Jun 2004 07:05:02 -0000 @@ -2432,12 +2432,12 @@ collect (cons (princ-to-string label) (print-part-to-string value)))))))
-(defun nth-part (index) +(defslimefun inspector-nth-part (index) (cdr (nth index *inspectee-parts*)))
(defslimefun inspect-nth-part (index) (with-buffer-syntax () - (inspect-object (nth-part index)))) + (inspect-object (inspector-nth-part index))))
(defslimefun inspector-pop () "Drop the inspector stack and inspect the second element. Return