[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Tue Nov 13 15:44:40 UTC 2012


Update of /project/slime/cvsroot/slime
In directory tiger.common-lisp.net:/tmp/cvs-serv25282

Modified Files:
	ChangeLog swank.lisp 
Log Message:
* swank-asdf.lisp: Better ASDF support.
* swank.lisp (*compile-file-for-emacs-hook*): A hook for
compile-file-for-emacs, so that ASDF can hook its compilation
functions.


--- /project/slime/cvsroot/slime/ChangeLog	2012/11/12 17:27:36	1.2368
+++ /project/slime/cvsroot/slime/ChangeLog	2012/11/13 15:44:39	1.2369
@@ -1,3 +1,9 @@
+2012-11-13  Francois-Rene Rideau <tunes at google.com>
+
+	* swank.lisp (*compile-file-for-emacs-hook*): A hook for
+	compile-file-for-emacs, so that ASDF can hook its compilation
+	functions.
+
 2012-11-12  Stas Boukarev  <stassats at gmail.com>
 
 	* swank.lisp (with-panic-handler): Abort the condition after
--- /project/slime/cvsroot/slime/swank.lisp	2012/11/12 17:27:36	1.797
+++ /project/slime/cvsroot/slime/swank.lisp	2012/11/13 15:44:40	1.798
@@ -2425,24 +2425,36 @@
                                    :loadp (if loadp t)
                                    :faslfile faslfile))))))
 
-(defslimefun compile-file-for-emacs (filename load-p &rest options &key policy
-                                              &allow-other-keys)
+(defun compile-file-with-compile-file (pathname load-p &rest options
+                                       &key policy
+                                       &allow-other-keys)
+  (multiple-value-bind (output-pathname warnings? failure?)
+      (swank-compile-file pathname
+                          (fasl-pathname pathname options)
+                          nil
+                          (or (guess-external-format pathname)
+                              :default)
+                          :policy policy)
+    (declare (ignore warnings?))
+    (values t (not failure?) load-p output-pathname)))
+
+(defvar *compile-file-for-emacs-hook* '(compile-file-with-compile-file))
+
+(defslimefun compile-file-for-emacs (filename load-p &rest options)
   "Compile FILENAME and, when LOAD-P, load the result.
 Record compiler notes signalled as `compiler-condition's."
   (with-buffer-syntax ()
     (collect-notes
      (lambda ()
        (let ((pathname (filename-to-pathname filename))
-             (*compile-print* nil) (*compile-verbose* t))
-         (multiple-value-bind (output-pathname warnings? failure?)
-             (swank-compile-file pathname
-                                 (fasl-pathname pathname options)
-                                 nil
-                                 (or (guess-external-format pathname)
-                                     :default)
-                                 :policy policy)
-           (declare (ignore warnings?))
-           (values (not failure?) load-p output-pathname)))))))
+             (*compile-print* nil)
+             (*compile-verbose* t))
+         (loop for hook in *compile-file-for-emacs-hook*
+               do
+               (multiple-value-bind (tried success load? output-pathname)
+                   (apply hook pathname load-p options)
+                 (when tried
+                   (return (values success load? output-pathname))))))))))
 
 (defvar *fasl-pathname-function* nil
   "In non-nil, use this function to compute the name for fasl-files.")





More information about the slime-cvs mailing list