[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Tue May 11 13:11:13 UTC 2010


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

Modified Files:
	ChangeLog slime.el 
Log Message:
(slime-parse-context): Add :defstruct and :defpackage.


--- /project/slime/cvsroot/slime/ChangeLog	2010/05/11 12:48:16	1.2089
+++ /project/slime/cvsroot/slime/ChangeLog	2010/05/11 13:11:13	1.2090
@@ -2,6 +2,7 @@
 
 	* slime.el (slime-inspect-definition): New function,
 	inspects definition at point.
+	(slime-parse-context): Add :defstruct and :defpackage.
 
 2010-05-10  Mark Evenson  <evenson at panix.com>
 
--- /project/slime/cvsroot/slime/slime.el	2010/05/11 12:48:17	1.1315
+++ /project/slime/cvsroot/slime/slime.el	2010/05/11 13:11:13	1.1316
@@ -4310,7 +4310,8 @@
  (defparameter n.ame ...)                -> (:defparameter name)
  (defconstant n.ame ...)                 -> (:defconstant name)
  (defclass n.ame ...)                    -> (:defclass name)
-
+ (defstruct n.ame ...)                   -> (:defstruct name)
+ (defpackage n.ame ...)                  -> (:defpackage name)
 For other contexts we return the symbol at point."
   (let ((name (slime-symbol-at-point)))
     (if name
@@ -4365,6 +4366,11 @@
           ((slime-in-expression-p '(defparameter *)) `(:defparameter ,name))
           ((slime-in-expression-p '(defconstant *))  `(:defconstant ,name))
           ((slime-in-expression-p '(defclass *))     `(:defclass ,name))
+          ((slime-in-expression-p '(defpackage *))   `(:defpackage ,name))
+          ((slime-in-expression-p '(defstruct *))
+           `(:defstruct ,(if (consp name)
+                             (car name)
+                             name)))
           (t 
            name))))
 
@@ -6548,8 +6554,11 @@
                  (format "#'%s" symbol))
                 (((:defparameter :defvar :defconstant) symbol)
                  (format "'%s" symbol))
-                ((:defclass symbol)
+                (((:defclass :defstruct) symbol)
                  (format "(find-class '%s)" symbol))
+                ((:defpackage symbol)
+                 (format "(or (find-package '%s) (error \"Package %s not found\"))"
+                         symbol symbol))
                 (t
                  (error "Not in a definition"))))))
     (slime-eval-async `(swank:init-inspector ,form) 'slime-open-inspector)))





More information about the slime-cvs mailing list