# HG changeset patch # User Augie Fackler # Date 1239911984 18000 # Node ID 79eec81404c3263bf96662e51856685d936493a2 # Parent b958738c16f34ee54169b430bd67887adf7ae395 Import latest nosemacs. diff --git a/.elisp/nose.el b/.elisp/nose.el --- a/.elisp/nose.el +++ b/.elisp/nose.el @@ -27,6 +27,20 @@ ;; 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"))) + +;; If you want dots as output, rather than the verbose output: +;; (defvar nose-use-verbose nil) ; default is t + ;; Probably also want some keybindings: ;; (add-hook 'python-mode-hook ;; (lambda () @@ -41,6 +55,7 @@ (defvar nose-project-root-files '("setup.py" ".hg" ".git")) (defvar nose-project-root-test 'nose-project-root) (defvar nose-global-name "nosetests") +(defvar nose-use-verbose t) (defun run-nose (&optional tests debug) "run nosetests" @@ -54,8 +69,11 @@ (compilation-start command nil (lambda (mode) (concat "*nosetests*"))))) - (format "%s -v %s -w %s -c %ssetup.cfg %s" - (nose-find-test-runner) args where where tnames))) + (format + (concat "%s " + (if nose-use-verbose "-v" "") + "%s -w %s -c %ssetup.cfg %s") + (nose-find-test-runner) args where where tnames))) ) (defun nosetests-all (&optional debug) @@ -136,12 +154,11 @@ 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) (t (nose-find-project-root (file-name-directory (directory-file-name dn)))))))