Skip to content

Commit

Permalink
mode: Silence warning about free variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleam committed Dec 10, 2023
1 parent ac857c4 commit 375e279
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions snakemake-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 375e279

Please sign in to comment.