unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Ergus <spacibba@aol.com>
Cc: 70794@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#70794: 30.0.50; Add Rust compilation regex
Date: Fri, 31 May 2024 19:15:52 +0200	[thread overview]
Message-ID: <16667D6C-F897-4A85-8C7A-0FA2E803FAA6@gmail.com> (raw)
In-Reply-To: <87y18nsp84.fsf@aol.com>

Ergus, thank you for your contribution! Some questions, if you don't mind:

* There aren't any tests. If you care anything at all about your pattern working, and keep working, you should add some.

We'll help you out, of course, but it's probably best if you give it a go yourself first so that we know exactly what you want to match. Take a look at compile-tests.el, `compile-tests--test-regexps-data`. You will also need to increase the expected counts at the end of `compile-test-error-regexps`.

* The regexp doesn't match the variant with error code inside square brackets, the

error[E0425]: cannot find function `ruun` in module `broot::cli`

kind of message. Surely you intended it to?

Here is your regexp again, translated to rx and with line numbers for ease of discussion:

1 (rx (| (group-n 4 "error") (group-n 5 "warning"))
2     ":"
3     (+? (not (in "\x00")))
4     "--> "
5     (group-n 1 (+ (not (in ":"))))
6     ":"
7     (group-n 2 (+ digit))
8     ":"
9     (group-n 3 (+ digit)))

* (Line 1): From the examples it appears that the messages start at the beginning of a line. We very much prefer to anchor matches for reasons of performance and to avoid collisions with other patterns. How about we add a line-start anchor at the very beginning?

* (Line 3): This is an open-ended expression which will merrily match just about anything including newlines. This can become very expensive. And where does that NUL come from?

In the examples you supplied, the message is on the first line, and the " --> " on the start of the second. Can we rely on that? If not, what can we rely on?

* (Line 5): This excludes Windows file names which can include colon or do cargo messages have a special notation for those? In any case, it's usually a good idea to exclude newline as well to prevent a runaway repetition.

* Both the rust-mode and rustic packages appear to include regexps that match the same messages. How do they compare to yours?

What is the effect of someone using those modes with your regexp in Emacs?







  parent reply	other threads:[~2024-05-31 17:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y18nsp84.fsf.ref@aol.com>
2024-05-06  1:28 ` bug#70794: 30.0.50; Add Rust compilation regex Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-11  8:51   ` Eli Zaretskii
2024-05-15 13:10     ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-18 10:52       ` Eli Zaretskii
2024-05-31 17:15   ` Mattias Engdegård [this message]
2024-06-03 14:41     ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-03 15:35       ` Mattias Engdegård
2024-06-03 14:54     ` Mattias Engdegård
2024-06-03 15:28       ` Eli Zaretskii
2024-06-03 16:22         ` Mattias Engdegård
2024-06-03 16:33           ` Eli Zaretskii
2024-06-03 16:59             ` Mattias Engdegård
2024-06-04 22:06               ` Stefan Kangas
2024-06-05 22:56                 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-06  7:34               ` Stefan Kangas
2024-06-03 22:36           ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 14:33             ` Eli Zaretskii
2024-06-03 15:30       ` Eli Zaretskii

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=16667D6C-F897-4A85-8C7A-0FA2E803FAA6@gmail.com \
    --to=mattias.engdegard@gmail.com \
    --cc=70794@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=spacibba@aol.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).