summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-11-19 00:35:13 -0500
committerKyle Meyer <kyle@kyleam.com>2014-11-19 00:35:13 -0500
commit29ac73cbed8784db8f1516aebec63ce578f76df9 (patch)
treebc4efe5a9f8134f1a08bf79f232b4a7ddc9a6b10 /lisp
parentcb2c3f351757be8a702ed13ebd76bed847ed7b11 (diff)
downloademacs.d-29ac73cbed8784db8f1516aebec63ce578f76df9.tar.gz
snakemake-compile-project-file-at-point: Add jobs flag
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-snakemake.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/init-snakemake.el b/lisp/init-snakemake.el
index 720d456..553cde3 100644
--- a/lisp/init-snakemake.el
+++ b/lisp/init-snakemake.el
@@ -11,15 +11,17 @@
(set (make-local-variable 'compile-command)
(snakemake-compile-command))))
-(defun km/snakemake-compile-project-file-at-point (arg)
+(defun km/snakemake-compile-project-file-at-point (jobs)
"Run Snakemake to produce project file at point.
-With prefix ARG, use file name as is, without trying to append
-the project's path."
- (interactive "P")
- (let* ((fname (if arg
- (thing-at-point 'filename)
- (km/project-filename-at-point)))
- (compile-command (concat (snakemake-compile-command) " "
+The numeric prefix JOBS controls the number of jobs that
+Snakemake runs (defaults to 1). If JOBS is zero, perform a dry
+run."
+ (interactive "p")
+ (let* ((fname (km/project-filename-at-point))
+ (job-flag (if (zerop jobs)
+ " -n "
+ (format " -j%s " jobs)))
+ (compile-command (concat (snakemake-compile-command) job-flag
fname))
(default-directory (projectile-project-root)))
(call-interactively 'compile)))