[slime-cvs] CVS slime

heller heller at common-lisp.net
Wed Sep 17 18:42:27 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv14019

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (slime-repl-popup-on-output): New variable.
(slime-repl-emit): Honor slime-repl-popup-on-output.
(slime-eval-with-transcript): Use slime-repl-popup-on-output.
Also remove the function argument, as it was only used once
and that was slime-message.

--- /project/slime/cvsroot/slime/ChangeLog	2008/09/17 18:42:17	1.1515
+++ /project/slime/cvsroot/slime/ChangeLog	2008/09/17 18:42:26	1.1516
@@ -5,10 +5,22 @@
 
 2008-09-17  Helmut Eller  <heller at common-lisp.net>
 
+	* slime.el (slime-repl-popup-on-output): New variable.
+	(slime-repl-emit): Honor slime-repl-popup-on-output.
+	(slime-eval-with-transcript): Use slime-repl-popup-on-output.
+	Also remove the function argument, as it was only used once
+	and that was slime-message.
+
+2008-09-17  Helmut Eller  <heller at common-lisp.net>
+
+	(*pre-reply-hook*): Add 'force-user-output.
+
+2008-09-17  Helmut Eller  <heller at common-lisp.net>
+
 	* swank.lisp (send-user-output): Lifted from make-output-function.
 	Make this a top-level function for easier redefinition.
 
-	(*pre-reply-hook*): Add 'force-user-output.
+2008-09-17  Helmut Eller  <heller at common-lisp.net>
 
 	* slime.el (slime-test-find-top-level-restart): New function.
 	[def-slime-test] (interrupt-at-toplevel, interrupt-in-debugger):
--- /project/slime/cvsroot/slime/slime.el	2008/09/17 08:25:34	1.1022
+++ /project/slime/cvsroot/slime/slime.el	2008/09/17 18:42:26	1.1023
@@ -2663,6 +2663,10 @@
     (:repl-result (slime-repl-emit-result string))
     (t (slime-emit-string string target))))
 
+(defvar slime-repl-popup-on-output nil
+  "Display the output buffer when some output is written.
+This is set to nil after displaying the buffer.")
+
 (defun slime-repl-emit (string)
   ;; insert the string STRING in the output buffer
   (with-current-buffer (slime-output-buffer)
@@ -2675,7 +2679,10 @@
                 (not (bolp)))
        (insert "\n")
        (set-marker slime-output-end (1- (point))))
-     (assert (<= (point) slime-repl-input-start-mark)))))
+     (assert (<= (point) slime-repl-input-start-mark))
+     (when slime-repl-popup-on-output
+       (setq slime-repl-popup-on-output nil)
+       (display-buffer (current-buffer))))))
 
 (defun slime-repl-insert-at-markers (marker1 marker2 string &optional props)
   (goto-char marker2)
@@ -5427,8 +5434,7 @@
   (interactive (list (slime-read-from-minibuffer "Slime Eval: ")))
   (slime-insert-transcript-delimiter string)
   (cond ((not current-prefix-arg)
-         (slime-eval-with-transcript `(swank:interactive-eval ,string) 
-                                     'slime-display-eval-result))
+         (slime-eval-with-transcript `(swank:interactive-eval ,string)))
         (t
          (slime-eval-print string))))
 
@@ -5444,21 +5450,15 @@
                           (destructuring-bind (output value) result
                             (insert output value)))))))
 
-(defun slime-eval-with-transcript (form &optional fn)
-  "Send FROM and PACKAGE to Lisp and pass the result to FN.
-Display the result in the message area, if FN is nil.
-Show the output buffer if the evaluation causes any output."
-  (with-current-buffer (slime-output-buffer)
-    (slime-with-output-end-mark 
-     (slime-mark-output-start)))
-  (slime-eval-async form
-                    (slime-rcurry 
-                     (lambda (value fn)
-                       (with-current-buffer (slime-output-buffer)
-                         (slime-show-last-output)
-                         (cond (fn (funcall fn value))
-                               (t (message "%s" value)))))
-                     fn)))
+(defun slime-eval-with-transcript (form)
+  "Eval FROM in Lisp.  Display output, if any, caused by the evaluation."
+  (setq slime-repl-popup-on-output t)
+  (slime-eval-async 
+   form
+   (lambda (value)
+     (run-with-timer 0.2 nil (lambda ()
+                               (setq slime-repl-popup-on-output nil)))
+     (slime-display-eval-result value))))
 
 (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