summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-01-17 16:50:39 -0500
committerKyle Meyer <kyle@kyleam.com>2016-01-17 16:50:39 -0500
commitde5210bfebc0526f19860fb93d4750b313745125 (patch)
treeab3d566478ed623640cb0d6bb40725a5575b0ca6
parent6e9f62f96e5ed02421bf698fe3767f4b494d7b92 (diff)
downloadsnakemake-mode-de5210bfebc0526f19860fb93d4750b313745125.tar.gz
Highlight Snakefile errors in compilation buffers
-rw-r--r--NEWS2
-rw-r--r--snakemake-mode.el7
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index c6228d4..225e007 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@
- The Imenu index now includes Python mode items in addition to rule
blocks.
+- Errors in Snakefiles are now highlighted in complilation buffers.
+
* v0.2.0
** New features
diff --git a/snakemake-mode.el b/snakemake-mode.el
index 7233d65..d219442 100644
--- a/snakemake-mode.el
+++ b/snakemake-mode.el
@@ -41,6 +41,7 @@
;;; Code:
+(require 'compile)
(require 'python)
@@ -325,6 +326,12 @@ command."
(call-interactively #'compile)))
("subworkflow" (user-error "Cannot compile a subworkflow"))))))
+(add-to-list 'compilation-error-regexp-alist 'snakemake)
+(add-to-list
+ 'compilation-error-regexp-alist-alist
+ '(snakemake . ("^SyntaxError in line \\([0-9]+\\) of \\(.*[^A-z]Snakefile\\):$"
+ 2 1)))
+
;;; Imenu