changeset 41785:b6a757de2fff

contrib: add compilation-mode linking for our test output These regular expressions will cause compilation-mode buffers in emacs to link to source when there are check-code errors in the output of a .t test. In the true tradition of this file, I also have no idea what I'm doing. Differential Revision: https://phab.mercurial-scm.org/D6000
author Augie Fackler <augie@google.com>
date Thu, 21 Feb 2019 19:59:00 -0500
parents 251332dbf33d
children b6c062bb4be3
files contrib/hg-test-mode.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hg-test-mode.el	Fri Feb 22 03:52:10 2019 +0530
+++ b/contrib/hg-test-mode.el	Thu Feb 21 19:59:00 2019 -0500
@@ -53,4 +53,11 @@
   (setq mode-name "hg-test")
   (run-hooks 'hg-test-mode-hook))
 
+(with-eval-after-load "compile"
+  ;; Link to source files in test-check-code.t violations.
+  (add-to-list 'compilation-error-regexp-alist-alist
+               '(hg-test-check-code-output
+                 "\\+  \\([^:\n]+\\):\\([0-9]+\\):$" 1 2))
+  (add-to-list 'compilation-error-regexp-alist 'hg-test-check-code-output))
+
 (provide 'hg-test-mode)