[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Mon Dec 14 09:06:35 UTC 2009


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

Modified Files:
	ChangeLog slime-asdf.el swank-asdf.lisp 
Log Message:
* contrib/slime-asdf.el (slime-delete-system-fasls): New command with a
shortcut `delete-system-fasls'.

* contrib/swank-asdf.lisp (delete-system-fasls): New function.
(asdf-module-output-files): New function for finding fasls.

* doc/slime.texi (ASDF): Document new commands.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/12 18:43:29	1.301
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/12/14 09:06:35	1.302
@@ -1,3 +1,11 @@
+2009-12-14  Stas Boukarev  <stassats at gmail.com>
+
+	* slime-asdf.el (slime-delete-system-fasls): New command with a
+	shortcut `delete-system-fasls'.
+
+	* swank-asdf.lisp (delete-system-fasls): New function.
+	(asdf-module-output-files): New function for finding fasls.
+
 2009-12-12  Matthias Koeppe  <mkoeppe at math.ucdavis.edu>
 
 	* slime-presentations.el (slime-reify-old-output): Revert change
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/11 03:05:24	1.20
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/12/14 09:06:35	1.21
@@ -166,6 +166,13 @@
   (tags-query-replace (regexp-quote from) to delimited
 		      '(slime-eval `(swank:asdf-system-files ,name))))
 
+(defun slime-delete-system-fasls (name)
+  "Delete FASLs produced by compiling a system."
+  (interactive (list (slime-read-system-name)))
+  (slime-repl-shortcut-eval-async
+   `(swank:delete-system-fasls ,name)
+   'message))
+
 
 ;;; REPL shortcuts
 
@@ -207,17 +214,17 @@
   (:one-liner "Recompile (but not load) an ASDF system."))
 
 (defslime-repl-shortcut slime-repl-open-system ("open-system")
-  (:handler (lambda ()
-              (interactive)
-              (call-interactively 'slime-open-system)))
+  (:handler 'slime-open-system)
   (:one-liner "Open all files in an ASDF system."))
 
 (defslime-repl-shortcut slime-repl-browse-system ("browse-system")
-  (:handler (lambda ()
-              (interactive)
-              (call-interactively 'slime-browse-system)))
+  (:handler 'slime-browse-system)
   (:one-liner "Browse files in an ASDF system using Dired."))
 
+(defslime-repl-shortcut slime-repl-delete-system-fasls ("delete-system-fasls")
+  (:handler 'slime-delete-system-fasls)
+  (:one-liner "Delete FASLs of an ASDF system."))
+
 
 ;;; Initialization
 
--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/11 03:05:24	1.18
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/12/14 09:06:35	1.19
@@ -76,6 +76,16 @@
                (asdf-module-files component))))
           (asdf:module-components module)))
 
+(defun asdf-module-output-files (module)
+  (mapcan (lambda (component)
+            (typecase component
+              (asdf:source-file
+               (asdf:output-files (make-instance 'asdf:compile-op)
+                                  component))
+              (asdf:module
+               (asdf-module-output-files component))))
+          (asdf:module-components module)))
+
 (defslimefun asdf-system-files (name)
   (let* ((system (asdf:find-system name))
          (files (mapcar #'namestring
@@ -133,4 +143,11 @@
           (return-from asdf-determine-system
             (asdf:component-name system)))))))
 
+(defslimefun delete-system-fasls (name)
+  (let ((removed-count
+         (loop for file in (asdf-module-output-files (asdf:find-system name))
+               when (probe-file file) count it
+               and do (delete-file file))))
+    (format nil "~d file~:p ~:*~[were~;was~:;were~] removed" removed-count)))
+
 (provide :swank-asdf)





More information about the slime-cvs mailing list