about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2013-08-10 21:07:51 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2013-08-25 14:15:03 +0200
commit521fb049be4642919d690a01ef8617a9508d3909 (patch)
tree6e84cd805b615e1adef2f94e0e7f892e7fe8eb09
parentbed84898fca9443f97fc3db17b0417c179d25803 (diff)
downloadrust-521fb049be4642919d690a01ef8617a9508d3909.tar.gz
rust-521fb049be4642919d690a01ef8617a9508d3909.zip
compilation error regexp specific to rustc.
Fix #6887.
-rw-r--r--src/etc/emacs/rust-mode.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el
index ecb223f896c..efe9f51e631 100644
--- a/src/etc/emacs/rust-mode.el
+++ b/src/etc/emacs/rust-mode.el
@@ -225,4 +225,19 @@ The initializer is `DEFAULT-TAB-WIDTH'.")
 
 (provide 'rust-mode)
 
+;; Issue #6887: Rather than inheriting the 'gnu compilation error
+;; regexp (which is broken on a few edge cases), add our own 'rust
+;; compilation error regexp and use it instead.
+(defvar rustc-compilation-regexps
+  (let ((re (concat "^\\([^ \n]+\\):\\([0-9]+\\):\\([0-9]+\\): "
+                    "\\([0-9]+\\):\\([0-9]+\\) "
+                    "\\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
+    (cons re '(1 (2 . 4) (3 . 5) (6))))
+  "Specifications for matching errors in rustc invocations.
+See `compilation-error-regexp-alist for help on their format.")
+
+(add-to-list 'compilation-error-regexp-alist-alist
+             (cons 'rustc rustc-compilation-regexps))
+(add-to-list 'compilation-error-regexp-alist 'rustc)
+
 ;;; rust-mode.el ends here