[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Tue Dec 15 17:12:42 UTC 2009


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

Modified Files:
	ChangeLog slime-asdf.el swank-asdf.lisp 
Log Message:
* contrib/slime-asdf.el (slime-reload-system): New command for reloading
a system without recompiling recursively its dependencies.
REPL shortcut for it is `reload-system'.

* contrib/swank-asdf.lisp (reload-system): New function.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/14 15:28:46	1.303
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/15 17:12:41	1.304
@@ -1,3 +1,11 @@
+2009-12-15  Stas Boukarev  <stassats at gmail.com>
+
+	* slime-asdf.el (slime-reload-system): New command for reloading
+	a system without recompiling recursively its dependencies.
+	REPL shortcut for it is `reload-system'.
+
+	* swank-asdf.lisp (reload-system): New function.
+
 2009-12-14  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	Take recursiveness of LABELS into account for displaying local
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/14 09:06:35	1.21
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/15 17:12:41	1.22
@@ -173,6 +173,16 @@
    `(swank:delete-system-fasls ,name)
    'message))
 
+(defun slime-reload-system (system)
+  "Reload an ASDF system without reloading its dependencies."
+  (interactive (list (slime-read-system-name)))
+  (slime-save-some-lisp-buffers)
+  (slime-display-output-buffer)
+  (message "Performing ASDF LOAD-OP on system %S" system)
+  (slime-repl-shortcut-eval-async
+   `(swank:reload-system ,system)
+   #'slime-compilation-finished))
+
 
 ;;; REPL shortcuts
 
@@ -225,6 +235,10 @@
   (:handler 'slime-delete-system-fasls)
   (:one-liner "Delete FASLs of an ASDF system."))
 
+(defslime-repl-shortcut slime-repl-reload-system ("reload-system")
+  (:handler 'slime-reload-system)
+  (:one-liner "Recompile and load an ASDF system."))
+
 
 ;;; Initialization
 
--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/14 09:06:35	1.19
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/15 17:12:41	1.20
@@ -31,7 +31,9 @@
 \(operate-on-system \"swank\" 'compile-op :force t)"
   (handler-case
       (with-compilation-hooks ()
-	(apply #'asdf:operate (find-operation operation-name) system-name keyword-args))
+	(apply #'asdf:operate (find-operation operation-name)
+               system-name keyword-args)
+        t)
     (asdf:compile-error () nil)))
 
 (defun asdf-central-registry ()
@@ -150,4 +152,23 @@
                and do (delete-file file))))
     (format nil "~d file~:p ~:*~[were~;was~:;were~] removed" removed-count)))
 
+(defvar *recompile-system* nil)
+
+(defmethod asdf:operation-done-p asdf:around ((operation asdf:compile-op)
+                                              component)
+  (unless (eql *recompile-system*
+               (asdf:component-system component))
+    (call-next-method)))
+
+(defslimefun reload-system (name)
+  (let* ((system (asdf:find-system name))
+         (*recompile-system* system))
+    (collect-notes
+     (lambda ()
+       (handler-case
+           (with-compilation-hooks ()
+             (asdf:oos 'asdf:load-op system)
+             t)
+         (asdf:compile-error () nil))))))
+
 (provide :swank-asdf)





More information about the slime-cvs mailing list