From c580c32e8a4831439a67679db01e8ef92c47b500 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 19 Nov 2014 00:35:32 -0500 Subject: snakemake-compile-project-file: Add file prompt Fall back to file prompt when there is no file at point. --- lisp/init-snakemake.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/init-snakemake.el') diff --git a/lisp/init-snakemake.el b/lisp/init-snakemake.el index 369167a..ccf35f8 100644 --- a/lisp/init-snakemake.el +++ b/lisp/init-snakemake.el @@ -11,13 +11,14 @@ (set (make-local-variable 'compile-command) (snakemake-compile-command)))) -(defun km/snakemake-compile-project-file-at-point (jobs) +(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." (interactive "p") - (let* ((fname (km/project-filename-at-point)) + (let* ((fname (or (km/project-filename-at-point) + (read-file-name "File: "))) (job-flag (if (zerop jobs) " -n " (format " -j%s " jobs))) @@ -36,7 +37,7 @@ run." (after 'init-external (define-key km/compile-map "p" - 'km/snakemake-compile-project-file-at-point) + 'km/snakemake-compile-project-file) (define-key km/compile-map "b" 'km/snakemake-compile-project-rule)) -- cgit v1.2.3