From 3ce395e2665d120d622b200636e65fbe47105f42 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 3 Jun 2015 01:10:02 -0400 Subject: Expose --touch flag in snakemake-compile-rule --- NEWS | 3 +++ snakemake-mode.el | 9 +++++---- 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))) -- cgit v1.2.3