summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-06-10 21:23:27 -0400
committerKyle Meyer <kyle@kyleam.com>2015-06-10 21:23:27 -0400
commite8cbf67a4ff59364795de5a8d6dbc660d43f76df (patch)
treee5bc4b5a62196d0cfc5598e029aa19c5c6b56fb3 /lisp
parent45ff23bf3ce141f898c625dfd74ee63a9a40101d (diff)
downloademacs.d-e8cbf67a4ff59364795de5a8d6dbc660d43f76df.tar.gz
Set imenu-create-index-function for snakemake
Need to set this as of snakemake-mode commit c6765aae71.
Diffstat (limited to 'lisp')
-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.