aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Barrett <ryanb@google.com>2012-06-13 16:24:40 -0400
committerSameer Ajmani <sameer@golang.org>2012-06-13 16:24:40 -0400
commit1ba00e32dad1086227e4c9f06ce8af6df7492669 (patch)
treeb94d9b3e76a4fe90560c33b02463a02554face72
parent4c35c0b498974aea513bc7f5f10a1e23d97eca8b (diff)
downloadgo-1ba00e32dad1086227e4c9f06ce8af6df7492669.tar.gz
go-1ba00e32dad1086227e4c9f06ce8af6df7492669.zip
[release-branch.go1] misc/emacs: make compilation-mode's next-error understand test failure output.
««« backport f469c9d212c4 misc/emacs: make compilation-mode's next-error understand test failure output. specifically, adds a go-test element to compilation-error-regexp-alist[-alist]. Fixes #3629. R=golang-dev, rsc, sameer CC=golang-dev, jba https://golang.org/cl/6197091 »»»
-rw-r--r--misc/emacs/go-mode.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el
index 2f20415010..4d6d736faa 100644
--- a/misc/emacs/go-mode.el
+++ b/misc/emacs/go-mode.el
@@ -729,7 +729,20 @@ functions, and some types. It also provides indentation that is
(set (make-local-variable 'comment-end) "")
;; Go style
- (setq indent-tabs-mode t))
+ (setq indent-tabs-mode t)
+
+ ;; Handle unit test failure output in compilation-mode
+ ;;
+ ;; Note the final t argument to add-to-list for append, ie put these at the
+ ;; *ends* of compilation-error-regexp-alist[-alist]. We want go-test to be
+ ;; handled first, otherwise other elements will match that don't work, and
+ ;; those alists are traversed in *reverse* order:
+ ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-12/msg00674.html
+ (when (and (boundp 'compilation-error-regexp-alist)
+ (boundp 'compilation-error-regexp-alist-alist))
+ (add-to-list 'compilation-error-regexp-alist 'go-test t)
+ (add-to-list 'compilation-error-regexp-alist-alist
+ '(go-test . ("^\t+\\([^()\t\n]+\\):\\([0-9]+\\):? .*$" 1 2)) t)))
;;;###autoload
(add-to-list 'auto-mode-alist (cons "\\.go$" #'go-mode))