[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Mon Mar 8 16:32:00 UTC 2010


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

Modified Files:
	ChangeLog slime-repl.el 
Log Message:
* contrib/slime-repl.el (slime-call-defun): Work also on defvar/defparameter.

* slime.el (slime-extract-context): Add defvar and defparameter.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/03/07 17:04:00	1.351
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/03/08 16:32:00	1.352
@@ -1,7 +1,11 @@
+2010-03-08  Stas Boukarev  <stassats at gmail.com>
+
+	* slime-repl.el (slime-call-defun): Work also on defvar/defparameter.
+
 2010-03-07  Stas Boukarev  <stassats at gmail.com>
 
-	* swank-fancy-inspector.lisp (stable-sort-by-inheritance): Remove copy-seq,
-	unnecessarily put in the previous commit.
+	* swank-fancy-inspector.lisp (stable-sort-by-inheritance): Remove
+	copy-seq, unnecessarily put in the previous commit.
 
 2010-03-07  Stas Boukarev  <stassats at gmail.com>
 
--- /project/slime/cvsroot/slime/contrib/slime-repl.el	2010/01/31 20:17:27	1.37
+++ /project/slime/cvsroot/slime/contrib/slime-repl.el	2010/03/08 16:32:00	1.38
@@ -1444,18 +1444,24 @@
 (defun slime-call-defun ()
   "Insert a call to the toplevel form defined around point into the REPL."
   (interactive)
-  (flet ((insert-call (symbol)
+  (flet ((insert-call (symbol &optional (function-call-p t))
            (let* ((qualified-symbol-name (slime-qualify-cl-symbol-name symbol))
                   (symbol-name (slime-cl-symbol-name qualified-symbol-name))
                   (symbol-package (slime-cl-symbol-package qualified-symbol-name))
-                  (function-call 
-                   (format "(%s " (if (equalp (slime-lisp-package) symbol-package)
-                                      symbol-name
-                                      qualified-symbol-name))))
+                  (call (if (equalp (slime-lisp-package) symbol-package)
+                            symbol-name
+                            qualified-symbol-name)))
              (slime-switch-to-output-buffer)
              (goto-char slime-repl-input-start-mark)
-             (insert function-call)
-             (save-excursion (insert ")")))))           
+             (insert (if function-call-p
+                         "("
+                         " "))
+             (insert call)
+             (when function-call-p
+               (insert " ")
+               (save-excursion (insert ")")))
+             (unless function-call-p
+               (goto-char slime-repl-input-start-mark)))))           
     (let ((toplevel (slime-parse-toplevel-form)))
       (if (symbolp toplevel)
           (error "Not in a function definition")
@@ -1465,6 +1471,8 @@
             ((:defmethod symbol &rest args)
              (declare (ignore args))
              (insert-call symbol))
+            (((:defparameter :defvar :defconstant) symbol)
+             (insert-call symbol nil))
             (t
              (error "Not in a function definition")))))))
 





More information about the slime-cvs mailing list