From 29ac73cbed8784db8f1516aebec63ce578f76df9 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 19 Nov 2014 00:35:13 -0500 Subject: snakemake-compile-project-file-at-point: Add jobs flag --- lisp/init-snakemake.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lisp/init-snakemake.el') 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))) -- cgit v1.2.3