From e8cbf67a4ff59364795de5a8d6dbc660d43f76df Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Wed, 10 Jun 2015 21:23:27 -0400 Subject: Set imenu-create-index-function for snakemake Need to set this as of snakemake-mode commit c6765aae71. --- lisp/init-snakemake.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lisp') 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. -- cgit v1.2.3