From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70794: 30.0.50; Add Rust compilation regex Date: Wed, 15 May 2024 15:10:02 +0200 Message-ID: References: <87y18nsp84.fsf.ref@aol.com> <87y18nsp84.fsf@aol.com> <86le4g3f5z.fsf@gnu.org> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2446"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70794@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 15 15:11:46 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s7EQ5-0000R3-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 15:11:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7EPR-0003uq-Kk; Wed, 15 May 2024 09:11:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7EPM-0003ub-Hk for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 09:11:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7EPM-0004I0-9E for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 09:11:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7EPN-0000v7-St for bug-gnu-emacs@gnu.org; Wed, 15 May 2024 09:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2024 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70794 X-GNU-PR-Package: emacs Original-Received: via spool by 70794-submit@debbugs.gnu.org id=B70794.17157786203518 (code B ref 70794); Wed, 15 May 2024 13:11:01 +0000 Original-Received: (at 70794) by debbugs.gnu.org; 15 May 2024 13:10:20 +0000 Original-Received: from localhost ([127.0.0.1]:42223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7EOf-0000ug-NF for submit@debbugs.gnu.org; Wed, 15 May 2024 09:10:20 -0400 Original-Received: from sonic303-2.consmr.mail.bf2.yahoo.com ([74.6.131.41]:35128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7EOc-0000uW-P8 for 70794@debbugs.gnu.org; Wed, 15 May 2024 09:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1715778607; bh=ZWH2mViHBI047YhScjU9jsKmDbtJTp5IB3DS1Uk7aFs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=U4XL5QEYYX483HF+Pybtd9lVG4x2VxwVyhloZu7VplSUbzN+2wRsMnVVMge+0vmxh81We2Gwbn6N1YCKV2Sprvdzb2wHLAKGEY3YfeWXrxbcBuRh0moAyxK5wUh3X6IKwTHrdcCjVvtHpNXenGRqhFqREyl/HbIv7bj8Y8dKSj1Kc6PLWsi7sNs+oncLWwn2DBEqSs9gZHM3GqV1pd2r4lfOBVXxWzisfib+ix48DDX4zmRb7yyTiZM5O2BJZTTXGoUqxAKPNDbS44Si95saZcpjtuR62nZc0eBFLb4KBx+XcQOff9QwRoAP09Kb08YFeGzvdzbstyX0+kmKT738pw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1715778607; bh=ZIKGxs2w5PrrbaKas7NBHLu8bhC1HKI+dEX2IlENfIp=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=NTqw69dx/OQjAdEBiFCT2G3UnPf8828SmJKR8tiDkq2nEYBYZmu73CgQF3KNIo6ANN8wAxiwyHJkrDeixYm/yS1Wgp9EHs50GVzuiiW4PgYPaSFlN2Ims7kkgou2nmMFEaH/1kgu+nkDFtizTutwYPxARklnx04dRaVWUjt32c8u548NVmWIRBAX8pIiE0JxtTtSDyugEqIoopM5fdjRAmNMP2KJ0+btJIghLyjqcufhcldkylrcp6RoSXD2rSbneRrlOWmnVYPg4QZMiConNz2p1e9nJL9XIPJ0RMCdRRLtUEVXGFy1pKiUTZgMi8bM8+ejwuAAFCCgJpNlK+bCpQ== X-YMail-OSG: DlsRbcAVM1mImvEatqpBX7JTMAL6VZV4A6m2bvxUv1LIwwgnJFwp6WPXmihWNhl 8YL3FThcB826XYkKB6.I4iIcRNUv6tl407hYbVgK8I4olI2.Pm6dNC7IkGVIrVqchAoo8U.LFbLH A5hW.ZC77TYXKBKK5kpWjNGohwleYt..X50rLmW.t8m.Rih5JRMAdehNKQEN_ARStbKOrSHyH8nP vX23UNRWD6vpeEaV7q72iDJsB5Yh.UaWmBuxsZ1gjIgyyVm_50vhUuk7R4boYNHyu4Eys6dM1abN XaZFYLrMjmCV1j3w2ey.NFq5FMOKOpdwfnTxgqhfokvyYeD_gn4mzVUFW22PP8NffEYu04kmQAFb 9OvCW.xM6Zwtnf5UUv76Atl3cF50y5Bo8gM8yKM8.ZydEooWovkKXwQLEViypWR63ocmvMu71L4b t3Y_CxWRx_CHvPEH85LrqfHX51FL0s9ArfuzHpPeVypMZjAiYPbsS1PM8xAey7RZJoy6LKZ1fGiX ekRXwVF6K3zFeqH.WgcZzzaj4ouhQIvQGhE_noFFtDDg2W7azW5ckncI94fU0eaWwGg6D9w4cnfg UgwIF.FLDra1_pUeE6dmylRAAtiS_fuCrzVoFVBAQRrau4rlZD_Kk2t2gwZVTiRiKgBafmQNOG3s kPnp4hO9kUU8qlTfusxM3VCrfut7WyIRSwpOj2Y.Z3hJK6.e03YrCxnMvgL1G4PGigiLzZAgn.ms jf60GGHJVOIzmel0snhU74_k4CPkCziBCxuwzcrxIk83hRubhLnQ4Oo_7lRd.rnrR3kYlOuYDiRD 2K8H_b0p2GRl1JgAGmcPq3PGp_ncxo6j3O0oFgLJ7O X-Sonic-MF: X-Sonic-ID: b840aa38-48e9-4915-a5b7-c8d60578c955 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Wed, 15 May 2024 13:10:07 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-dmk2d (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID bf05b5f70d5b599b1691c1ae922cadfa; Wed, 15 May 2024 13:10:04 +0000 (UTC) Content-Disposition: inline In-Reply-To: <86le4g3f5z.fsf@gnu.org> X-Mailer: WebService/1.1.22356 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285082 Archived-At: On Sat, May 11, 2024 at 11:51:04AM GMT, Eli Zaretskii wrote: >> Date: Mon, 06 May 2024 03:28:43 +0200 >> From: Ergus via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> 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? Hi Eli: Typically they look like this: ``` error[E0425]: cannot find function `ruun` in module `broot::cli` --> src/main.rs:6:23 | 6 | match broot::cli::ruun() { | ^^^^ help: a function with a similar name exists: `run` | ::: /tmp/broot/src/cli/mod.rs:49:1 | 49 | pub fn run() -> Result, ProgramError> { | -------------------------------------------------------- similarly named function `run` defined here ``` or ``` error: cannot find macro `deebug` in this scope --> src/main.rs:5:5 | 5 | deebug!("env::args(): {:#?}", std::env::args().collect::>()); | ^^^^^^ help: a macro with a similar name exists: `debug` | ::: /home/ergo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/log-0.4.21/src/macros.rs:154:1 | 154 | macro_rules! debug { | ------------------ similarly named macro `debug` defined here ``` ``` warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` --> src/main.rs:3:1 | 3 | #[feature(proc_macro_diagnostic)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_attributes)]` on by default ``` Two details: 1. As you can see the [] is optional 2. The path is always relative to project's root