summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/init-snakemake.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/init-snakemake.el b/lisp/init-snakemake.el
index 9e45634..53f57c6 100644
--- a/lisp/init-snakemake.el
+++ b/lisp/init-snakemake.el
@@ -5,14 +5,17 @@
(setq snakemake-compile-command-options '("-p"))
-;; Although `compile-command' is set when snakemake-mode is derived
-;; from Python mode, I need to define it again here because I have a
-;; Python mode hook that sets `compile-command', which overrides the
-;; snakemake version.
-(add-hook 'snakemake-mode-hook
- (lambda ()
- (set (make-local-variable 'compile-command)
- (snakemake-compile-command))))
+;; Although `compile-command' and `imenu-create-index-function' are
+;; set when snakemake-mode is derived from Python mode, I need to
+;; define them again here because I have a Python mode hook overrides
+;; the Python versions.
+(add-hook 'snakemake-mode-hook #'km/snakemake-set-local-vars)
+
+(defun km/snakemake-set-local-vars ()
+ (set (make-local-variable 'compile-command)
+ (snakemake-compile-command))
+ (set (make-local-variable 'imenu-create-index-function)
+ #'snakemake-imenu-create-index))
(defun km/snakemake-compile-project-file (jobs)
"Run Snakemake to produce project file at point.