aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--snakemake-mode.el9
2 files changed, 8 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index c456238..cd28d0b 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@
another line, indentation cycling now includes a step that indents
according to Python mode.
+- `snakemake-compile-rule' can now pass the '--touch' flag to
+ snakemake.
+
* v0.2.0
** New features
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 929f3bd..5eeefb7 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -296,7 +296,7 @@ Flags are taken from `snakemake-compile-command-options'."
The numeric prefix JOBS controls the number of jobs that
Snakemake runs (defaults to 1). If JOBS is zero, perform a dry
-run.
+run. If JOBS is negative, just touch the output files.
Customize `snakemake-executable' and
`snakemake-compile-command-options' to control the compilation
@@ -311,9 +311,10 @@ command."
(rule-name (match-string-no-properties 2)))
(pcase block-type
("rule"
- (let* ((job-flag (if (zerop jobs)
- " -n "
- (format " -j%s " jobs)))
+ (let* ((job-flag (cond
+ ((> jobs 0) (format " -j%s " jobs))
+ ((zerop jobs) " -n ")
+ (t " -t ")))
(compile-command (concat (snakemake-compile-command) job-flag
rule-name)))
(call-interactively #'compile)))