Commit ca9f0e75 authored by Mattias Engdegård's avatar Mattias Engdegård
Browse files

Omit the `omake` compilation-mode rule by default

It keeps interfering with other rules, slowing everything down a
little bit and makes it harder to add or change other rules.  The rule
is still there and can easily be re-enabled by those who need it.

* etc/NEWS: Announce.
* lisp/progmodes/compile.el (compilation-error-regexp-alist):
Exclude `omake`.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
Actually test the `cucumber` rule. Remove the `omake` test case.
(compile-test-error-regexps):
Test `omake` here.  Test other rules without `omake` included.
parent cfcdb6ec
Pipeline #26665 failed with stages
in 116 minutes and 54 seconds
......@@ -299,6 +299,14 @@ equivalent to the "--heading" option of some tools such as 'git grep'
and 'rg'. The headings are displayed using the new 'grep-heading'
face.
---
** Compilation mode
*** The 'omake' matching rule is now disabled by default.
This is because it partly acts by modifying other rules which may
occasionally be surprising. It can be re-enabled by adding 'omake' to
'compilation-error-regexp-alist'.
** VC
---
......
......@@ -683,7 +683,10 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
"Alist of values for `compilation-error-regexp-alist'.")
(defcustom compilation-error-regexp-alist
(mapcar #'car compilation-error-regexp-alist-alist)
;; Omit `omake' by default: its mere presence here triggers special processing
;; and modifies regexps for other rules (see `compilation-parse-errors'),
;; which may slow down matching (or even cause mismatches).
(delq 'omake (mapcar #'car compilation-error-regexp-alist-alist))
"Alist that specifies how to match errors in compiler output.
On GNU and Unix, any string is a valid filename, so these
matchers must make some common sense assumptions, which catch
......
......@@ -121,9 +121,7 @@
;; cucumber
(cucumber "Scenario: undefined step # features/cucumber.feature:3"
29 nil 3 "features/cucumber.feature")
;; This rule is actually handled by the `cucumber' pattern but when
;; `omake' is included, then `gnu' matches it first.
(gnu " /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'"
(cucumber " /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'"
1 nil 500 "/home/gusev/.rvm/foo/bar.rb")
;; edg-1 edg-2
(edg-1 "build/intel/debug/../../../struct.cpp(42): error: identifier \"foo\" is undefined"
......@@ -312,10 +310,6 @@
1 nil 109 "..\\src\\ctrl\\lister.c")
(watcom "..\\src\\ctrl\\lister.c(120): Warning! W201: Unreachable code"
1 nil 120 "..\\src\\ctrl\\lister.c")
;; omake
;; FIXME: This doesn't actually test the omake rule.
(gnu " alpha.c:5:15: error: expected ';' after expression"
1 15 5 "alpha.c")
;; oracle
(oracle "Semantic error at line 528, column 5, file erosacqdb.pc:"
1 5 528 "erosacqdb.pc")
......@@ -497,8 +491,22 @@ The test data is in `compile-tests--test-regexps-data'."
(font-lock-mode -1)
(let ((compilation-num-errors-found 0)
(compilation-num-warnings-found 0)
(compilation-num-infos-found 0))
(mapc #'compile--test-error-line compile-tests--test-regexps-data)
(compilation-num-infos-found 0)
(all-rules (mapcar #'car compilation-error-regexp-alist-alist)))
;; Test all built-in rules except `omake' to avoid interference.
(let ((compilation-error-regexp-alist (remq 'omake all-rules)))
(mapc #'compile--test-error-line compile-tests--test-regexps-data))
;; Test the `omake' rule separately.
;; This doesn't actually test the `omake' rule itself but its
;; indirect effects.
(let ((compilation-error-regexp-alist all-rules)
(test
'(gnu " alpha.c:5:15: error: expected ';' after expression"
1 15 5 "alpha.c")))
(compile--test-error-line test))
(should (eq compilation-num-errors-found 100))
(should (eq compilation-num-warnings-found 35))
(should (eq compilation-num-infos-found 28)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment