Jason Pellerin avatar Jason Pellerin committed fea37a2

Updated doc comment, fixed custom project root test

Comments (0)

Files changed (1)

 ;; Note that if your global nose isn't called "nosetests", then you'll want to
 ;; redefine nose-global-name to be the command that should be used.
 
+;; By default, the root of a project is found by looking for any of the files
+;; 'setup.py', '.hg' and '.git'. You can add files to check for to the file
+;; list:
+;;
+;; ; (add-to-list 'nose-project-root-files "something")
+
+;; or you can change the project root test to detect in some other way 
+;; whether a directory is the project root:
+;;
+;; ; (setq nose-project-root-test (lambda (dirname) (equal dirname "foo")))
+
 ;; Probably also want some keybindings:
 ;; (add-hook 'python-mode-hook
 ;;           (lambda ()
        result))))
 
 (defun nose-find-project-root (&optional dirname)  
-  (interactive)
   (let ((dn
          (if dirname
              dirname 
            (file-name-directory buffer-file-name))))
-    (cond ((nose-project-root dn) (expand-file-name dn))
+    (cond ((funcall nose-project-root-test dn) (expand-file-name dn))
           ((equal (expand-file-name dn) "/") nil)
         (t1 (nose-find-project-root
              (file-name-directory (directory-file-name dn)))))))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.