summaryrefslogtreecommitdiff
path: root/lisp/init-snakemake.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-11-19 00:35:32 -0500
committerKyle Meyer <kyle@kyleam.com>2014-11-19 00:35:32 -0500
commitc580c32e8a4831439a67679db01e8ef92c47b500 (patch)
tree2a97a0cd42ce78c99e90599f340bb30aaa412978 /lisp/init-snakemake.el
parentdb4b3e65bdfb957b90fa81c5c4fcdaca1859e781 (diff)
downloademacs.d-c580c32e8a4831439a67679db01e8ef92c47b500.tar.gz
snakemake-compile-project-file: Add file prompt
Fall back to file prompt when there is no file at point.
Diffstat (limited to 'lisp/init-snakemake.el')
-rw-r--r--lisp/init-snakemake.el7
1 files changed, 4 insertions, 3 deletions
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))