summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-06-08 20:54:18 -0400
committerKyle Meyer <kyle@kyleam.com>2015-06-08 20:54:18 -0400
commitf86e0c5cba0028474e35fa218e972958d2673dd6 (patch)
tree1c844a45c67a360d5a899b1005a6b4a5093ad877
parent32fcc90d69147681581c656348e4af22ea5639ed (diff)
downloademacs.d-f86e0c5cba0028474e35fa218e972958d2673dd6.tar.gz
Expose --touch to snakemake-compile-project-file
-rw-r--r--lisp/init-snakemake.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/init-snakemake.el b/lisp/init-snakemake.el
index e41bfb5..9e45634 100644
--- a/lisp/init-snakemake.el
+++ b/lisp/init-snakemake.el
@@ -17,14 +17,15 @@
(defun km/snakemake-compile-project-file (jobs)
"Run Snakemake to produce project file at point.
The numeric prefix JOBS controls the number of jobs that
-Snakemake runs (defaults to 1). If JOBS is zero, perform a dry
-run."
+Snakemake runs (defaults to 1). If JOBS is zero, perform a dry
+run. If JOBS is negative, just touch the output files."
(interactive "p")
(let* ((fname (or (km/project-filename-at-point)
(read-file-name "File: ")))
- (job-flag (if (zerop jobs)
- " -n "
- (format " -j%s " jobs)))
+ (job-flag (cond
+ ((> jobs 0) (format " -j%s " jobs))
+ ((zerop jobs) " -n ")
+ (t " -t ")))
(compile-command (concat (snakemake-compile-command) job-flag
fname))
(default-directory (projectile-project-root)))