[slime-cvs] CVS slime/contrib
CVS User sboukarev
sboukarev at common-lisp.net
Wed Oct 21 13:26:36 UTC 2009
Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv12887/contrib
Modified Files:
ChangeLog slime-asdf.el swank-asdf.lisp
Log Message:
* contrib/slime-asdf.el (slime-browse-system): New command for browsing
files in asdf using Dired.
* contrib/swank-asdf.lisp (asdf-system-loaded-p): New function.
--- /project/slime/cvsroot/slime/contrib/ChangeLog 2009/10/20 21:28:38 1.258
+++ /project/slime/cvsroot/slime/contrib/ChangeLog 2009/10/21 13:26:36 1.259
@@ -1,3 +1,10 @@
+2009-10-21 Stas Boukarev <stassats at gmail.com>
+
+ * slime-asdf.el (slime-browse-system): New command for browsing
+ files in asdf using Dired.
+
+ * swank-asdf.lisp (asdf-system-loaded-p): New function.
+
2009-10-20 Stas Boukarev <stassats at gmail.com>
* slime-parse.el (slime-parse-sexp-at-point): Remove unused flet.
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2009/10/19 22:46:24 1.9
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2009/10/21 13:26:36 1.10
@@ -69,14 +69,33 @@
#'slime-compilation-finished))
(defun slime-open-system (name &optional load)
- (interactive (list (slime-read-system-name)
- (y-or-n-p "Load it? ")))
- (when load
+ "Open all files in an ASDF system."
+ (interactive (list (slime-read-system-name)))
+ (when (or load
+ (and (called-interactively-p)
+ (not (slime-eval `(swank:asdf-system-loaded-p ,name)))
+ (y-or-n-p "Load it? ")))
(slime-load-system name))
- (slime-repl-shortcut-eval-async
+ (slime-eval-async
`(swank:asdf-system-files ,name)
(lambda (files) (mapc 'find-file files))))
+(defun slime-browse-system (name &optional load)
+ "Browse files in an ASDF system using Dired."
+ (interactive (list (slime-read-system-name)))
+ (when (or load
+ (and (called-interactively-p)
+ (not (slime-eval `(swank:asdf-system-loaded-p ,name)))
+ (y-or-n-p "Load it? ")))
+ (slime-load-system name))
+ (slime-eval-async
+ `(swank:asdf-system-files ,name)
+ (lexical-let ((name name))
+ (lambda (files)
+ (when files
+ (dired (cons (format "ASDF system %s" name)
+ files)))))))
+
(defslime-repl-shortcut slime-repl-load/force-system ("force-load-system")
(:handler (lambda ()
(interactive)
@@ -114,6 +133,18 @@
(slime-oos (slime-read-system-name) "COMPILE-OP" :force t)))
(: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)))
+ (: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)))
+ (:one-liner "Browse files in an ASDF system using Dired."))
+
(defun slime-asdf-on-connect ()
(slime-eval-async '(swank:swank-require :swank-asdf)))
--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2009/10/19 22:46:24 1.8
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2009/10/21 13:26:36 1.9
@@ -77,4 +77,8 @@
(mapcar #'namestring
(asdf-module-files (asdf:find-system system))))
+(defslimefun asdf-system-loaded-p (system)
+ (gethash 'asdf:load-op
+ (asdf::component-operation-times (asdf:find-system system))))
+
(provide :swank-asdf)
More information about the slime-cvs
mailing list