[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Fri Oct 1 09:30:34 UTC 2010


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

Modified Files:
	ChangeLog slime.el 
Log Message:
Save result in kill ring for M-- C-x C-e.
For C-u C-x C-e set mark before inserting.

* slime.el (slime-eval-save): New function.
(slime-eval-print): Set mark before inserting.
(slime-interactive-eval): Use it.

--- /project/slime/cvsroot/slime/ChangeLog	2010/09/22 19:17:35	1.2144
+++ /project/slime/cvsroot/slime/ChangeLog	2010/10/01 09:30:34	1.2145
@@ -1,3 +1,12 @@
+2010-10-01  Helmut Eller  <heller at common-lisp.net>
+
+	Save result in kill ring for M-- C-x C-e.
+	For C-u C-x C-e set mark before inserting.
+
+	* slime.el (slime-eval-save): New function.
+	(slime-eval-print): Set mark before inserting.
+	(slime-interactive-eval): Use it.
+
 2010-09-22  Stas Boukarev  <stassats at gmail.com>
 
 	* swank.lisp (eval-for-emacs): Send (:abort condition) where
--- /project/slime/cvsroot/slime/slime.el	2010/09/22 19:17:35	1.1340
+++ /project/slime/cvsroot/slime/slime.el	2010/10/01 09:30:34	1.1341
@@ -4055,26 +4055,22 @@
 Note: If a prefix argument is in effect then the result will be
 inserted in the current buffer."
   (interactive (list (slime-read-from-minibuffer "Slime Eval: ")))
-  (cond ((not current-prefix-arg)
-         (slime-eval-with-transcript `(swank:interactive-eval ,string)))
-        (t
-         (slime-eval-print string))))
-
-(defun slime-display-eval-result (value)
-  (slime-message "%s" value))
-
-(defun slime-eval-print (string)
-  "Eval STRING in Lisp; insert any output and the result at point."
-  (slime-eval-async `(swank:eval-and-grab-output ,string)
-                    (lambda (result)
-                      (destructuring-bind (output value) result
-                        (insert output value)))))
+  (case current-prefix-arg
+    ((nil)
+     (slime-eval-with-transcript `(swank:interactive-eval ,string)))
+    ((-)
+     (slime-eval-save string))
+    (t
+     (slime-eval-print string))))
 
 (defvar slime-transcript-start-hook nil
   "Hook run before start an evalution.")
 (defvar slime-transcript-stop-hook nil
   "Hook run after finishing a evalution.")
 
+(defun slime-display-eval-result (value)
+  (slime-message "%s" value))
+
 (defun slime-eval-with-transcript (form)
   "Eval FROM in Lisp.  Display output, if any."
   (run-hooks 'slime-transcript-start-hook)
@@ -4085,6 +4081,23 @@
     ((:abort condition)
      (run-hooks 'slime-transcript-stop-hook)
      (message "Evaluation aborted on %s." condition))))
+
+(defun slime-eval-print (string)
+  "Eval STRING in Lisp; insert any output and the result at point."
+  (slime-eval-async `(swank:eval-and-grab-output ,string)
+                    (lambda (result)
+                      (destructuring-bind (output value) result
+                        (push-mark)
+                        (insert output value)))))
+
+(defun slime-eval-save (string)
+  "Evaluate STRING in Lisp and save the result in the kill ring."
+  (slime-eval-async `(swank:eval-and-grab-output ,string)
+    (lambda (result)
+      (destructuring-bind (output value) result
+        (let ((string (concat output value)))
+          (kill-new string)
+          (message "Evaluation finished; pushed result to kill ring."))))))
         
 (defun slime-eval-describe (form)
   "Evaluate FORM in Lisp and display the result in a new buffer."





More information about the slime-cvs mailing list