[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Thu Oct 16 21:15:28 UTC 2008


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

Modified Files:
	ChangeLog slime.el swank-abcl.lisp swank-backend.lisp 
	swank-clisp.lisp swank-cmucl.lisp swank-ecl.lisp 
	swank-lispworks.lisp swank-sbcl.lisp swank-scl.lisp 
Log Message:
* swank-backend.lisp (swank-compile-file): Return the same
values as COMPILE-FILE.  Update backends accordingly.

--- /project/slime/cvsroot/slime/ChangeLog	2008/10/16 21:15:08	1.1556
+++ /project/slime/cvsroot/slime/ChangeLog	2008/10/16 21:15:28	1.1557
@@ -1,5 +1,10 @@
 2008-10-16  Helmut Eller  <heller at common-lisp.net>
 
+	* swank-backend.lisp (swank-compile-file): Return the same
+	values as COMPILE-FILE.  Update backends accordingly.
+
+2008-10-16  Helmut Eller  <heller at common-lisp.net>
+
 	* swank-openmcl.lisp (frame-catch-tags): Disabled as it prevents
 	FRAME-LOCALS from working in lx8632.
 
--- /project/slime/cvsroot/slime/slime.el	2008/10/10 06:09:32	1.1047
+++ /project/slime/cvsroot/slime/slime.el	2008/10/16 21:15:28	1.1048
@@ -8967,6 +8967,26 @@
              subform)))
   (slime-check-top-level))
 
+(def-slime-test (compile-file ("allegro" "lispworks" "clisp"))
+    (string)
+    "Insert STRING in a file, and compile it."
+    `((,(pp-to-string '(defun foo () nil))))
+  (let ((filename "/tmp/slime-tmp-file.lisp"))
+    (with-temp-file filename
+      (insert string))
+    (let ((cell (cons nil nil)))
+      (slime-eval-async
+       `(swank:compile-file-for-emacs ,filename nil)
+       (slime-rcurry (lambda (result cell)
+                       (setcar cell t)
+                       (setcdr cell result))
+                     cell))
+      (slime-wait-condition "Compilation finished" (lambda () (car cell))
+                            0.5)
+      (let ((result (cdr cell)))
+        (slime-check "Compilation successfull" 
+          (eq (slime-compilation-result.successp result) t))))))
+
 (def-slime-test async-eval-debugging (depth)
   "Test recursive debugging of asynchronous evaluation requests."
   '((1) (2) (3))
--- /project/slime/cvsroot/slime/swank-abcl.lisp	2008/09/17 06:19:48	1.55
+++ /project/slime/cvsroot/slime/swank-abcl.lisp	2008/10/16 21:15:28	1.56
@@ -338,8 +338,10 @@
       (let ((*buffer-name* nil)
             (*compile-filename* filename))
         (multiple-value-bind (fn warn fail) (compile-file filename)
-          (when (and load-p (not fail))
-            (load fn)))))))
+          (values fn warn
+                  (or fail 
+                      (and load-p 
+                           (not (load fn))))))))))
 
 (defimplementation swank-compile-string (string &key buffer position directory
                                                 debug)
--- /project/slime/cvsroot/slime/swank-backend.lisp	2008/10/04 19:13:41	1.155
+++ /project/slime/cvsroot/slime/swank-backend.lisp	2008/10/16 21:15:28	1.156
@@ -371,9 +371,11 @@
   (declare (ignore ignore))
   `(call-with-compilation-hooks (lambda () (progn , at body))))
 
-(definterface swank-compile-string (string &key buffer position directory debug)
-  "Compile source from STRING.  During compilation, compiler
-conditions must be trapped and resignalled as COMPILER-CONDITIONs.
+(definterface swank-compile-string (string &key buffer position directory 
+                                           debug)
+  "Compile source from STRING.
+During compilation, compiler conditions must be trapped and
+resignalled as COMPILER-CONDITIONs.
 
 If supplied, BUFFER and POSITION specify the source location in Emacs.
 
@@ -397,7 +399,8 @@
 EXTERNAL-FORMAT is a value returned by find-external-format or
 :default.
 
-Should return T on successfull compilation, NIL otherwise.")
+Should return OUTPUT-TRUENAME, WARNINGS-P and FAILURE-p
+like `compile-file'")
 
 (deftype severity () 
   '(member :error :read-error :warning :style-warning :note))
--- /project/slime/cvsroot/slime/swank-clisp.lisp	2008/09/17 06:19:48	1.78
+++ /project/slime/cvsroot/slime/swank-clisp.lisp	2008/10/16 21:15:28	1.79
@@ -598,11 +598,12 @@
 (defimplementation swank-compile-file (filename load-p external-format)
   (with-compilation-hooks ()
     (with-compilation-unit ()
-      (let ((fasl-file (compile-file filename
-                                     :external-format external-format)))
-        (when (and load-p fasl-file)
-          (load fasl-file))
-        nil))))
+      (multiple-value-bind (fasl-file warningsp failurep)
+          (compile-file filename :external-format external-format)
+        (values fasl-file warningsp
+                (or failurep 
+                    (and load-p 
+                         (not (load fasl-file)))))))))
 
 (defimplementation swank-compile-string (string &key buffer position directory
                                          debug)
--- /project/slime/cvsroot/slime/swank-cmucl.lisp	2008/10/11 08:30:57	1.200
+++ /project/slime/cvsroot/slime/swank-cmucl.lisp	2008/10/16 21:15:28	1.201
@@ -371,13 +371,12 @@
           (ext:*ignore-extra-close-parentheses* nil))
       (multiple-value-bind (output-file warnings-p failure-p)
           (compile-file filename)
-        (declare (ignore warnings-p))
-        (cond (failure-p nil)
-              (load-p
-               ;; Cache the latest source file for definition-finding.
-               (source-cache-get filename (file-write-date filename))
-               (load output-file))
-              ((not failure-p)))))))
+        (values output-file warnings-p
+                (or failure-p
+                    (when load-p
+                      ;; Cache the latest source file for definition-finding.
+                      (source-cache-get filename (file-write-date filename))
+                      (not (load output-file)))))))))
 
 (defimplementation swank-compile-string (string &key buffer position directory
                                                 debug)
--- /project/slime/cvsroot/slime/swank-ecl.lisp	2008/09/26 23:14:10	1.32
+++ /project/slime/cvsroot/slime/swank-ecl.lisp	2008/10/16 21:15:28	1.33
@@ -145,7 +145,7 @@
     (let ((*buffer-name* nil))
       (multiple-value-bind (fn warn fail) 
           (compile-file *compile-filename*)
-        (when load-p (unless fail (load fn)))))))
+        (values fn warn (or fail (and load-p (not (load fn)))))))))
 
 (defimplementation swank-compile-string (string &key buffer position directory
                                                 debug)
--- /project/slime/cvsroot/slime/swank-lispworks.lisp	2008/10/04 08:04:42	1.118
+++ /project/slime/cvsroot/slime/swank-lispworks.lisp	2008/10/16 21:15:28	1.119
@@ -425,7 +425,8 @@
 
 (defimplementation swank-compile-file (filename load-p external-format)
   (with-swank-compilation-unit (filename)
-    (compile-file filename :load load-p :external-format external-format)))
+    (compile-file filename :load load-p 
+                  :external-format external-format)))
 
 (defvar *within-call-with-compilation-hooks* nil
   "Whether COMPILE-FILE was called from within CALL-WITH-COMPILATION-HOOKS.")
--- /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/10/04 19:13:41	1.223
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp	2008/10/16 21:15:28	1.224
@@ -467,14 +467,15 @@
 
 (defimplementation swank-compile-file (pathname load-p external-format)
   (handler-case
-      (let ((output-file (with-compilation-hooks ()
-                           (compile-file pathname 
-                                         :external-format external-format))))
-        (when output-file
-          ;; Cache the latest source file for definition-finding.
-          (source-cache-get pathname (file-write-date pathname))
-          (when load-p
-            (load output-file))))
+      (multiple-value-bind (output-file warnigns-p failure-p)
+          (with-compilation-hooks ()
+            (compile-file pathname :external-format external-format))
+        (values output-file warnings-p
+                (or failure-p
+                    (when load-p
+                      ;; Cache the latest source file for definition-finding.
+                      (source-cache-get pathname (file-write-date pathname))
+                      (not (load output-file))))))
     (sb-c:fatal-compiler-error () nil)))
 
 ;;;; compile-string
--- /project/slime/cvsroot/slime/swank-scl.lisp	2008/10/04 19:13:41	1.27
+++ /project/slime/cvsroot/slime/swank-scl.lisp	2008/10/16 21:15:28	1.28
@@ -444,11 +444,12 @@
           (ext:*ignore-extra-close-parentheses* nil))
       (multiple-value-bind (output-file warnings-p failure-p)
           (compile-file filename :external-format external-format)
-        (unless failure-p
-          ;; Cache the latest source file for definition-finding.
-          (source-cache-get filename (file-write-date filename))
-          (when load-p (load output-file)))
-        (values output-file warnings-p failure-p)))))
+        (values output-file warnings-p
+                (or failure-p
+                    (when load-p
+                      ;; Cache the latest source file for definition-finding.
+                      (source-cache-get filename (file-write-date filename))
+                      (not (load output-file)))))))))
 
 (defimplementation swank-compile-string (string &key buffer position directory
                                                 debug)





More information about the slime-cvs mailing list