From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39595@debbugs.gnu.org, jidanni@jidanni.org, pogonyshev@gmail.com,
monnier@iro.umontreal.ca
Subject: bug#39595: #39595: M-x compile still very line-length weak
Date: Sat, 15 Feb 2020 17:45:54 +0100 [thread overview]
Message-ID: <E4BC9D74-6DDC-4741-8694-E84D97724354@acm.org> (raw)
In-Reply-To: <83k14onvzl.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
15 feb. 2020 kl. 08.35 skrev Eli Zaretskii <eliz@gnu.org>:
> I'm okay with disabling 'omake' if we have nowhere else to ask.
We may not have to, after all. Reading the OMake sources, it very much looks like errors are indented by exactly 6 spaces, which means that we can replace (* " ") with (? "6 spaces") which is a lot faster.
Having done that, it turned out that recognising ruby-Test::Unit errors depended on the old 'omake' regexp rewriting (another reason to disable omake by default, perhaps), so that regexp had to be fixed as well.
Along with the two previous patches (for msft, watcom and maven), this should reduce the cost of long lines to something more tolerable for the time being.
[-- Attachment #2: 0001-Make-OMake-support-slightly-less-expensive-bug-39595.patch --]
[-- Type: application/octet-stream, Size: 4598 bytes --]
From 79f816e614218bce2c15d550bc2cf1a591f22e43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Sat, 15 Feb 2020 16:08:14 +0100
Subject: [PATCH] Make OMake support slightly less expensive (bug#39595)
When run with -p or -P, OMake regurgitates error messages that
prevented further progress, indented by 6 spaces. Use that fact
to ameliorate the modification done to other error message regexps.
* lisp/progmodes/compile.el (compilation-parse-errors):
When 'omake' is enabled, allow error messages to be indented by 0 or 6
spaces instead of any number of spaces, to avoid pathological
behaviour.
(compilation-error-regexp-alist-alist): Anchor the 'omake' pattern to
bol for performance. Repair the 'ruby-Test::Unit' pattern, which
relied on the previously over-generous 'omake' hack.
* etc/compilation.txt (OMake): Add examples.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test for OMake (indented error).
---
etc/compilation.txt | 16 ++++++++++++++++
lisp/progmodes/compile.el | 6 +++---
test/lisp/progmodes/compile-tests.el | 5 ++++-
3 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/etc/compilation.txt b/etc/compilation.txt
index a597216daa..69db891907 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -382,6 +382,22 @@ symbol: watcom
..\src\ctrl\lister.c(120): Warning! W201: Unreachable code
+* OMake
+
+symbol: omake
+
+When using in -p or -P mode, OMake will detect changes to files and
+report critical build errors indented by 6 spaces.
+
+*** omake: file alpha.c changed
+*** omake: targets were not rebuilt because of errors:
+ alpha.o
+ depends on: alpha.c
+ - build . alpha.o
+ + cc -I. -c -o alpha.o alpha.c
+ alpha.c:5:15: error: expected ';' after expression
+
+
* Oracle pro*c
symbol: oracle
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 79d2293e21..dcd2e59f10 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -310,7 +310,7 @@ compilation-error-regexp-alist-alist
1 2 3 (4 . 5))
(ruby-Test::Unit
- "^[\t ]*\\[\\([^(].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
+ "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
(gmake
;; Set GNU make error messages as INFO level.
@@ -410,7 +410,7 @@ compilation-error-regexp-alist-alist
(omake
;; "omake -P" reports "file foo changed"
;; (useful if you do "cvs up" and want to see what has changed)
- "omake: file \\(.*\\) changed" 1 nil nil nil nil
+ "^\\*\\*\\* omake: file \\(.*\\) changed" 1 nil nil nil nil
;; FIXME-omake: This tries to prevent reusing pre-existing markers
;; for subsequent messages, since those messages's line numbers
;; are about another version of the file.
@@ -1457,7 +1457,7 @@ compilation-parse-errors
((not (memq 'omake compilation-error-regexp-alist)) nil)
((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat)
nil) ;; Not anchored or anchored but already allows empty spaces.
- (t (setq pat (concat "^ *" (substring pat 1)))))
+ (t (setq pat (concat "^\\(?: \\)?" (substring pat 1)))))
(if (consp file) (setq fmt (cdr file) file (car file)))
(if (consp line) (setq end-line (cdr line) line (car line)))
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index 350b4eb400..01db77c9c3 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -269,6 +269,9 @@ compile-tests--test-regexps-data
1 nil 109 "..\\src\\ctrl\\lister.c")
("..\\src\\ctrl\\lister.c(120): Warning! W201: Unreachable code"
1 nil 120 "..\\src\\ctrl\\lister.c")
+ ;; omake
+ (" alpha.c:5:15: error: expected ';' after expression"
+ 1 15 5 "alpha.c")
;; oracle
("Semantic error at line 528, column 5, file erosacqdb.pc:"
1 5 528 "erosacqdb.pc")
@@ -428,7 +431,7 @@ compile-test-error-regexps
(compilation-num-warnings-found 0)
(compilation-num-infos-found 0))
(mapc #'compile--test-error-line compile-tests--test-regexps-data)
- (should (eq compilation-num-errors-found 92))
+ (should (eq compilation-num-errors-found 93))
(should (eq compilation-num-warnings-found 36))
(should (eq compilation-num-infos-found 26)))))
--
2.21.1 (Apple Git-122.3)
next prev parent reply other threads:[~2020-02-15 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 5:51 bug#39595: M-x compile still very line-length weak 積丹尼 Dan Jacobson
2020-02-14 11:18 ` bug#39595: #39595: " Mattias Engdegård
2020-02-14 16:27 ` Mattias Engdegård
2020-02-14 17:00 ` Eli Zaretskii
2020-02-14 22:47 ` Mattias Engdegård
2020-02-15 7:35 ` Eli Zaretskii
2020-02-15 16:45 ` Mattias Engdegård [this message]
2020-02-16 12:15 ` Mattias Engdegård
2020-02-15 1:28 ` 積丹尼 Dan Jacobson
2020-02-15 13:57 ` Stefan Monnier
2020-02-16 15:37 ` 積丹尼 Dan Jacobson
2020-02-17 11:07 ` Mattias Engdegård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E4BC9D74-6DDC-4741-8694-E84D97724354@acm.org \
--to=mattiase@acm.org \
--cc=39595@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jidanni@jidanni.org \
--cc=monnier@iro.umontreal.ca \
--cc=pogonyshev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).