[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70794: 30.0.50; Add Rust compilation regex
From: |
Eli Zaretskii |
Subject: |
bug#70794: 30.0.50; Add Rust compilation regex |
Date: |
Sat, 11 May 2024 11:51:04 +0300 |
> Date: Mon, 06 May 2024 03:28:43 +0200
> From: Ergus via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Recently working with rust I have noticed that emacs does not recognizes
> the rust/cargo error patterns.
>
> Considering that emacs has now the rust-ts-mode, it may worth adding
> the rust/cargo error patterns to compile when using that mode
>
> In my system so far I have this:
>
> ```
> (with-eval-after-load 'rust-ts-mode
> (with-eval-after-load 'compile
> (add-to-list
> 'compilation-error-regexp-alist-alist
> `(cargo
> "\\(?:\\(?4:error\\)\\|\\(?5:warning\\)\\):[^\0]+?-->
> \\(?1:[^:]+\\):\\(?2:[[:digit:]]+\\):\\(?3:[[:digit:]]+\\)"
> 1 2 3 (5)
> nil
> (5 compilation-warning-face)
> (4 compilation-error-face)))
>
> (add-to-list 'compilation-error-regexp-alist 'cargo)))
>
> ```
>
> Maybe a more frequent rust user has a more general regex to
> recommend. But this one works for me.
>
> WDYT?
Thanks, but could you please also send the examples of Rust messages,
because we need to add them to etc/compilation.txt?