summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-snakemake.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/init-snakemake.el b/lisp/init-snakemake.el
index 65230de..720d456 100644
--- a/lisp/init-snakemake.el
+++ b/lisp/init-snakemake.el
@@ -11,12 +11,17 @@
(set (make-local-variable 'compile-command)
(snakemake-compile-command))))
-(defun km/snakemake-compile-project-file-at-point ()
- "Run Snakemake to produce project file at point."
- (interactive)
- (let ((compile-command (concat (snakemake-compile-command) " "
- (km/project-filename-at-point)))
- (default-directory (projectile-project-root)))
+(defun km/snakemake-compile-project-file-at-point (arg)
+ "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) " "
+ fname))
+ (default-directory (projectile-project-root)))
(call-interactively 'compile)))
(autoload 'snakemake-compile-command "snakemake-mode")