emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode f8b4bf9 300/495: Add to beginning of compilation-e


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode f8b4bf9 300/495: Add to beginning of compilation-error-regexp-alist
Date: Sat, 7 Aug 2021 09:05:35 -0400 (EDT)

branch: elpa/go-mode
commit f8b4bf90ca3057a0376c1660ac967d0577dabdbe
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>

    Add to beginning of compilation-error-regexp-alist
    
    Older versions of Emacs (somewhen before 24.5.1) processed the list from
    the back. Newer versions (somewhen around 24.5.1) seem to process it
    from the beginning.
    
    We need our entry to be processed before gnu, to prevent gnu from
    matching go test output incorrectly.
---
 NEWS       |  3 +++
 go-mode.el | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 339b0a9..27c768f 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,9 @@ go-mode-1.4.0 (???)
    useful when using godoc instead of go doc, and thus defaults to
    off.
 
+ * Fix parsing of test output in compilation-mode for new versions of
+   Emacs. It's probably broken in older versions now.
+
 go-mode-1.3.1 (2015-07-03)
 
  * The 1.3.0 release forgot to update the version in the package
diff --git a/go-mode.el b/go-mode.el
index 7124edb..c6f97c3 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -983,14 +983,19 @@ with goflymake \(see URL 
`https://github.com/dougm/goflymake'), gocode
 
   ;; 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:
+  ;; Note that we add our entry to the beginning of
+  ;; compilation-error-regexp-alist. In older versions of Emacs, the
+  ;; list was processed from the end, and we would've wanted to add
+  ;; ours last. But at some point this changed, and now the list is
+  ;; processed from the beginning. It's important that our entry comes
+  ;; before gnu, because gnu matches go test output, but includes the
+  ;; leading whitespace in the file name.
+  ;; 
   ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-12/msg00674.html
+  ;; documents the old, reverseed order.
   (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 'go-test)
     (add-to-list 'compilation-error-regexp-alist-alist
                  '(go-test . ("^\t+\\([^()\t\n]+\\):\\([0-9]+\\):? .*$" 1 2)) 
t)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]