[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Tue May 11 12:48:17 UTC 2010


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

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (slime-inspect-definition): New function,
inspects definition at point.


--- /project/slime/cvsroot/slime/ChangeLog	2010/05/10 05:29:43	1.2088
+++ /project/slime/cvsroot/slime/ChangeLog	2010/05/11 12:48:16	1.2089
@@ -1,3 +1,8 @@
+2010-05-11  Stas Boukarev  <stassats at gmail.com>
+
+	* slime.el (slime-inspect-definition): New function,
+	inspects definition at point.
+
 2010-05-10  Mark Evenson  <evenson at panix.com>
 
 	* swank-loader.lisp (*architecture-features*): Add Java platforms
--- /project/slime/cvsroot/slime/slime.el	2010/05/05 18:10:17	1.1314
+++ /project/slime/cvsroot/slime/slime.el	2010/05/11 12:48:17	1.1315
@@ -6529,6 +6529,31 @@
 				     (slime-sexp-at-point))))
   (slime-eval-async `(swank:init-inspector ,string) 'slime-open-inspector))
 
+(defun slime-inspect-definition ()
+  "Inspect definition at point"
+  (interactive)
+  (let* ((toplevel (slime-parse-toplevel-form))
+         (form
+          (if (symbolp toplevel)
+              (error "Not in a definition")
+              (destructure-case toplevel
+                (((:defun :defgeneric) symbol)
+                 (format "#'%s" symbol))
+                (((:defmacro :define-modify-macro) symbol)
+                 (format "(macro-function '%s)" symbol))
+                ((:define-compiler-macro symbol)
+                 (format "(compiler-macro-function '%s)" symbol))
+                ((:defmethod symbol &rest args)
+                 (declare (ignore args))
+                 (format "#'%s" symbol))
+                (((:defparameter :defvar :defconstant) symbol)
+                 (format "'%s" symbol))
+                ((:defclass symbol)
+                 (format "(find-class '%s)" symbol))
+                (t
+                 (error "Not in a definition"))))))
+    (slime-eval-async `(swank:init-inspector ,form) 'slime-open-inspector)))
+
 (define-derived-mode slime-inspector-mode fundamental-mode
   "Slime-Inspector"
   "





More information about the slime-cvs mailing list