Permalink
Browse files

Add compile all for nosetests and shortcuts.

  • Loading branch information...
1 parent a8bb548 commit 3438724466ed2225748ced58d370f8d0be5b2b9d @chmouel committed Jan 12, 2013
Showing with 16 additions and 6 deletions.
  1. +1 −0 configs/programming/python.el
  2. +15 −6 modes/nosetests.el
@@ -24,6 +24,7 @@
(flymake-mode 't)
(local-set-key '[(control c)(\[)] 'flymake-goto-prev-error)
(local-set-key '[(control c)(\])] 'flymake-goto-next-error)
+ (local-set-key (kbd "C-S-y") 'nosetests-compile-module)
(local-set-key (kbd "C-S-t") 'nosetests-copy-shell-comand)
(local-set-key (kbd "C-S-r") 'nosetests-compile)
(which-func-mode 't)
View
@@ -34,30 +34,39 @@
((equal inner-obj outer-obj) outer-obj)
(t (format "%s.%s" outer-obj inner-obj)))))
-(defun nosetests-get-command (&optional withcd)
+(defun nosetests-get-command (&optional withcd module)
(let (topdir test-path current-function cmd)
(setq topdir (file-truename (or (locate-dominating-file
(buffer-file-name) "setup.py") "./")))
(setq test-path (substring (file-truename
(buffer-file-name))
(length topdir)))
- (setq current-function (nose-py-testable))
- (if (not current-function)
- (error "No function at point"))
+ (when (not module)
+ (setq current-function (nose-py-testable))
+ (if (not current-function)
+ (error "No function at point")))
(setq cmd "")
(if withcd
(setq cmd (concat "cd " topdir ";")))
(concat cmd "nosetests "
- nosetests-arg " " test-path ":"
- current-function)))
+ nosetests-arg " " test-path
+ (if (not module)
+ (concat ":" current-function)))
+ ))
(defun nosetests-compile ()
(interactive)
(let (cmd)
(setq cmd (nosetests-get-command t))
(compile cmd)))
+(defun nosetests-compile-module ()
+ (interactive)
+ (let (cmd)
+ (setq cmd (nosetests-get-command t t))
+ (compile cmd)))
+
(defun nosetests-copy-shell-comand ()
(interactive)
(let (cmd)

0 comments on commit 3438724

Please sign in to comment.