From fc2b4e58b232173a9987a2c7f7dbd02e3f6631e1 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 2 Sep 2016 21:21:50 -0400 Subject: Support 'wildcard_constraints' keyword wildcard_constraints was added in Snakemake v3.8.0 (feb6aee). --- NEWS | 7 +++++++ snakemake-mode.el | 2 ++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 78f198e..c448cc2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ NEWS -- history of user-visible changes -*- mode: org; -*- +* v0.6.0 (unreleased) + +** New features + +- The 'wildcard_constraints' keyword (new in Snakemake v3.8.0) is now + recognized. + * v0.5.0 ** New features diff --git a/snakemake-mode.el b/snakemake-mode.el index 82d8103..7e2ff8c 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -95,6 +95,7 @@ "shell" "threads" "version" + "wildcard_constraints" "wrapper" ;; Keys for subworkflow blocks "snakefile" @@ -106,6 +107,7 @@ "onerror" "onsuccess" "ruleorder" + "wildcard_constraints" "workdir") symbol-end)) (sm-func . ,(rx symbol-start -- cgit v1.2.3 From d79027959fadb2049b045874723b0897ebb91aa1 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 2 Sep 2016 21:50:11 -0400 Subject: Decrease font lock precedence of command keywords The keyword wildcard_constraints can be either a top-level command or a rule field keyword. The previous order in snakemake-font-lock-keywords resulted in wildcard_constraints always be highlighted as a command key. Rearrange the font lock list order to put the field key entry first. This should result in the correct highlighting in every case except for when a command key is indented (e.g., under an "if"), but this presumably will occur much less frequently than wildcard_constraints being used as a field keyword. --- snakemake-mode.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snakemake-mode.el b/snakemake-mode.el index 7e2ff8c..b397e2d 100644 --- a/snakemake-mode.el +++ b/snakemake-mode.el @@ -413,16 +413,16 @@ embedded R, you need to set mmm-global-mode to a non-nil value such as 'maybe.") (1 font-lock-keyword-face nil 'lax) (2 font-lock-function-name-face nil 'lax) (3 font-lock-keyword-face nil 'lax)) - (,(snakemake-rx line-start (zero-or-more space) - (group sm-command) - (zero-or-more space) ":") - 1 font-lock-keyword-face) (,(snakemake-rx (group sm-func) (zero-or-more space) "(") 1 font-lock-builtin-face) (,(snakemake-rx line-start (one-or-more space) (group field-key) (zero-or-more space) ":") - 1 font-lock-type-face))) + 1 font-lock-type-face) + (,(snakemake-rx line-start (zero-or-more space) + (group sm-command) + (zero-or-more space) ":") + 1 font-lock-keyword-face))) ;;;###autoload (define-derived-mode snakemake-mode python-mode "Snakemake" -- cgit v1.2.3