diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-06-28 15:56:00 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-06-28 15:56:00 -0400 |
commit | 2f2f9a94042b9b7a0ca5c58c89a7c40649e8bf26 (patch) | |
tree | 6006017fae8137fb6d3ea9b7663217c712c74b1c | |
parent | a5c3d0e120ffce53f7d7887fee9acf979691db6a (diff) | |
download | snakemake-mode-2f2f9a94042b9b7a0ca5c58c89a7c40649e8bf26.tar.gz |
Reorder mode definition
This avoids free variable warning about `snakemake-font-lock-keywords'
when compiling.
-rw-r--r-- | snakemake-mode.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/snakemake-mode.el b/snakemake-mode.el index bdbb298..dff3651 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -194,13 +194,6 @@ indentation is determined by the location within the rule block. ;;; Mode -;;;###autoload -(define-derived-mode snakemake-mode python-mode "Snakemake" - "Mode for editing Snakemake files." - (set (make-local-variable 'indent-line-function) 'snakemake-indent-line) - (font-lock-add-keywords nil snakemake-font-lock-keywords) - (set (make-local-variable 'compile-command) "snakemake")) - (defvar snakemake-font-lock-keywords `((,snakemake-rule-line-re (1 font-lock-keyword-face) (2 font-lock-function-name-face)) @@ -217,6 +210,13 @@ indentation is determined by the location within the rule block. (add-hook 'snakemake-mode-hook 'snakemake-set-imenu-generic-expression) ;;;###autoload +(define-derived-mode snakemake-mode python-mode "Snakemake" + "Mode for editing Snakemake files." + (set (make-local-variable 'indent-line-function) 'snakemake-indent-line) + (font-lock-add-keywords nil snakemake-font-lock-keywords) + (set (make-local-variable 'compile-command) "snakemake")) + +;;;###autoload (add-to-list 'auto-mode-alist '("Snakefile" . snakemake-mode)) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.smrules" . snakemake-mode)) |