[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Mon Nov 16 15:47:55 UTC 2009


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

Modified Files:
	ChangeLog slime-asdf.el swank-asdf.lisp 
Log Message:
* swank-asdf.lisp (asdf-determine-system): New function
for determining to what system a file belongs.

* slime-asdf.el (slime-rgrep-system): New function.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/11/13 21:04:26	1.274
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/11/16 15:47:54	1.275
@@ -1,3 +1,10 @@
+2009-11-16  Stas Boukarev  <stassats at gmail.com>
+
+	* swank-asdf.lisp (asdf-determine-system): New function for
+	determining to what system a file belongs.
+
+	* slime-asdf.el (slime-rgrep-system): New function.
+
 2009-11-13  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* swank-arglists.lisp (extra-keywords/make-instance)
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/10/21 19:38:49	1.12
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el	2009/11/16 15:47:55	1.13
@@ -87,14 +87,19 @@
 (defun slime-browse-system (name)
   "Browse files in an ASDF system using Dired."
   (interactive (list (slime-read-system-name)))
-  (slime-eval-async 
-   `(cl:directory-namestring
-     (cl:truename
-      (asdf:system-definition-pathname (asdf:find-system ,name))))
+  (slime-eval-async `(asdf-system-directory ,name)
    (lambda (directory)
      (when directory
        (dired directory)))))
 
+(defun slime-rgrep-system (system-name regexp)
+  (interactive (list (slime-read-system-name
+                      nil
+                      (slime-eval `(swank:asdf-determine-system ,(buffer-file-name))))
+                     (grep-read-regexp)))
+  (rgrep regexp "*.lisp"
+         (slime-eval `(swank:asdf-system-directory ,system-name))))
+
 (defslime-repl-shortcut slime-repl-load/force-system ("force-load-system")
   (:handler (lambda ()
               (interactive)
--- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/10/21 19:38:49	1.10
+++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp	2009/11/16 15:47:55	1.11
@@ -73,18 +73,29 @@
                  (asdf-module-files component))))
           (asdf:module-components module)))
 
-(defslimefun asdf-system-files (system)
+(defslimefun asdf-system-files (name)
   (let* ((files (mapcar #'namestring
-                        (asdf-module-files (asdf:find-system system))))
-         (main-file (find system files
+                        (asdf-module-files (asdf:find-system name))))
+         (main-file (find name files
                           :test #'string-equal
                           :key #'pathname-name)))
     (if main-file
         (cons main-file (remove main-file files :test #'equalp))
         files)))
 
-(defslimefun asdf-system-loaded-p (system)
+(defslimefun asdf-system-loaded-p (name)
   (gethash 'asdf:load-op
-           (asdf::component-operation-times (asdf:find-system system))))
+           (asdf::component-operation-times (asdf:find-system name))))
+
+(defslimefun asdf-system-directory (name)
+  (cl:directory-namestring
+   (cl:truename
+    (asdf:system-definition-pathname (asdf:find-system name)))))
+
+(defslimefun asdf-determine-system (file)
+  (find-if (lambda (system)
+             (member file (asdf-system-files system)
+                     :test #'equal))
+           (list-all-systems-known-to-asdf)))
 
 (provide :swank-asdf)





More information about the slime-cvs mailing list