[slime-cvs] CVS update: slime/swank.lisp
Helmut Eller
heller at common-lisp.net
Sat Nov 1 15:45:10 UTC 2003
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv1762
Modified Files:
swank.lisp
Log Message:
(slime-read-char): Flush the output before reading.
(eval-region, listener-eval): New functions.
(interactive-eval-region): Use eval-region.
Date: Sat Nov 1 10:45:10 2003
Author: heller
Index: slime/swank.lisp
diff -u slime/swank.lisp:1.48 slime/swank.lisp:1.49
--- slime/swank.lisp:1.48 Fri Oct 31 14:25:06 2003
+++ slime/swank.lisp Sat Nov 1 10:45:10 2003
@@ -163,6 +163,7 @@
(defvar *read-input-catch-tag* 0)
(defun slime-read-char ()
+ (force-output)
(let ((*read-input-catch-tag* (1+ *read-input-catch-tag*)))
(send-to-emacs `(:read-char ,*read-input-catch-tag*))
(code-char (catch *read-input-catch-tag*
@@ -199,14 +200,18 @@
(force-output)
(format nil "~{~S~^, ~}" values)))
+(defun eval-region (string)
+ (with-input-from-string (stream string)
+ (loop for form = (read stream nil stream)
+ until (eq form stream)
+ for - = form
+ for values = (multiple-value-list (eval form))
+ do (force-output)
+ finally (return (values values -)))))
+
(defslimefun interactive-eval-region (string)
(let ((*package* *buffer-package*))
- (with-input-from-string (stream string)
- (loop for form = (read stream nil stream)
- until (eq form stream)
- for result = (multiple-value-list (eval form))
- do (force-output)
- finally (return (format nil "~{~S~^, ~}" result))))))
+ (format nil "~{~S~^, ~}" (eval-region string))))
(defslimefun re-evaluate-defvar (form)
(let ((*package* *buffer-package*))
@@ -230,6 +235,13 @@
(defslimefun set-package (package)
(setq *package* (guess-package-from-string package))
(package-name *package*))
+
+(defslimefun listener-eval (string)
+ (multiple-value-bind (values last-form) (eval-region string)
+ (setq +++ ++ ++ + + last-form
+ *** ** ** * * (car values)
+ /// // // / / values)
+ (format nil "~{~S~^, ~}" values)))
;;;; Compilation Commands.
More information about the slime-cvs
mailing list