aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2023-12-10 15:08:15 -0500
committerKyle Meyer <kyle@kyleam.com>2023-12-10 15:08:15 -0500
commit375e279ed33dcf66e876a85c83585488dd43158b (patch)
treef0322232839e5f9158018a492939fdb9e8749239
parentac857c4f48220b3386b289a47e77722db43a30c9 (diff)
downloadsnakemake-mode-375e279ed33dcf66e876a85c83585488dd43158b.tar.gz
mode: Silence warning about free variable
-rw-r--r--snakemake-mode.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 7b06a92..fd4763a 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -457,6 +457,7 @@ embedded R, you need to set mmm-global-mode to a non-nil value such as `maybe'."
(,(rx line-start (group "use rule ")) 1 font-lock-keyword-face)
(,(snakemake-rx (group sm-builtin)) 1 font-lock-builtin-face)))
+(defvar snakemake-font-lock-keywords)
(if (bound-and-true-p python-font-lock-keywords-level-1)
(with-no-warnings
;; In Emacs 27 `python-font-lock-keywords' was split up into
@@ -470,14 +471,14 @@ embedded R, you need to set mmm-global-mode to a non-nil value such as `maybe'."
(defvar snakemake-font-lock-keywords-maximum-decoration
(append snakemake--font-lock-keywords
python-font-lock-keywords-maximum-decoration))
- (defvar snakemake-font-lock-keywords
- ;; Mirrors `python-font-lock-keywords'.
- '(snakemake-font-lock-keywords-level-1
- snakemake-font-lock-keywords-level-1
- snakemake-font-lock-keywords-level-2
- snakemake-font-lock-keywords-maximum-decoration)))
- (defvar snakemake-font-lock-keywords
- (append snakemake--font-lock-keywords python-font-lock-keywords)))
+ (setq snakemake-font-lock-keywords
+ ;; Mirrors `python-font-lock-keywords'.
+ '(snakemake-font-lock-keywords-level-1
+ snakemake-font-lock-keywords-level-1
+ snakemake-font-lock-keywords-level-2
+ snakemake-font-lock-keywords-maximum-decoration)))
+ (setq snakemake-font-lock-keywords
+ (append snakemake--font-lock-keywords python-font-lock-keywords)))
;;;###autoload
(define-derived-mode snakemake-mode python-mode "Snakemake"