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: Tue, 4 Jun 2024 00:36:17 +0200 Message-ID: References: <16667D6C-F897-4A85-8C7A-0FA2E803FAA6@gmail.com> <86sexukpuh.fsf@gnu.org> <8BC5E59B-63B1-4784-9454-51925E9DBCFC@gmail.com> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7431"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70794@debbugs.gnu.org, Eli Zaretskii To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 04 00:37:11 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 1sEGIg-0001hV-Q4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jun 2024 00:37:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEGIM-0006Pf-QY; Mon, 03 Jun 2024 18:36:50 -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 1sEGIL-0006PU-A0 for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 18:36:49 -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 1sEGIK-0003Uo-Id for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 18:36:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEGIX-0005ZH-KT for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 18:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jun 2024 22:37: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.171745420321366 (code B ref 70794); Mon, 03 Jun 2024 22:37:01 +0000 Original-Received: (at 70794) by debbugs.gnu.org; 3 Jun 2024 22:36:43 +0000 Original-Received: from localhost ([127.0.0.1]:55940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEGIE-0005YY-UA for submit@debbugs.gnu.org; Mon, 03 Jun 2024 18:36:43 -0400 Original-Received: from sonic316-12.consmr.mail.bf2.yahoo.com ([74.6.130.122]:44614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEGID-0005YM-8D for 70794@debbugs.gnu.org; Mon, 03 Jun 2024 18:36:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1717454182; bh=G5VK1YL1HBtaxeO/KnDV7h3AB96X8C5cQQErn96g8BM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=BpcovCh2MZTwwflLCwACigth1dgMmdNmr3YtZygkaxBm5jtOWcCDk6OVTUrcq10iAE8KAlhudCktxWHn+xTZd61Zk4xTwsfBC83JBZjsZ0cs5WrX3Ld4M9yYPxfqgzdHxK8ENCX3cN72GtE1qz2TGu9fIrBHfiNE3z4AqYnbZR9lK0emxMUf2ZKdLcGlLWPKXOiwqqHvtVlY54ANZv2uruD0PmfKhobHUhFw4mSWWTVS04+EI+5btkM2TSDf0j3do0JTgS1DXFC4G6fefjBFN8JWNWfMAN9WitgnWHb/KaQpRyMBXPQ3JTrumWGHT+QOoVOZcuGBbhbu0StYgUv9BA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1717454182; bh=B7FFKACMV6F8tMChlgWrJl5NVeWYRI6jzhcEUHTKkTC=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=scFyRVu9UaL9hnwGXPTm+SDcFjT5EjfNcGcnoSPZac7kENW6APDsX4dY+SV/wccDUG0ERaEmRCcImr8RB0PV6DSnBwLpL0X0APiqHhxbQ8+SjJtI612Yf/VYr6hmnRhTYHTjLGnhEH4FyPK8HssiEBZ5VP2PkuAH2mSY2UNR8iVnaXBWx+O14XY4vGHrXkNX+BGakSB5159GU9O1O8f8jHFaaIbTxDeWPTttpdtvbagYaWQUxuHWgIzYH9D4+Wq0cE0yHEKtjTIaQtx1swjI1EogDi8/+r3+ScGalDwEU5ryxxopvuCyvdCki50NzgnYVEjVchbr+ztckL0/Iq5SmA== X-YMail-OSG: DKA0eEgVM1nsU4VtQi3L_3yKEmWDyvglNSULlgfEf8RC2PkobrFoPROxezKNjwO sUPVhOiS.fYA4rz_07hI5paA5t2R_12l9JSK5bx9CrzPKMPxxw7nr3C2NwcQK_TZutaFupto_Plg _jywYsTAJsqfUKCOOk9tnTIxD.Pz3WPWyH_BBHL9N_knoDCHVMOXV0gC4ZKFXuk6WlGXVZBPo4V. .X2JoEKbxKb78RRV_dDFw2w_NyHAQkWTw0.XXehpEHDTrpvfFi_cWwN7EBQODt9loP4R_vR9Se6d KPyxwaa8AZx0sn0Af9tsUkSxOSnRZtz5B3ZWw3y1XHYR.qj6ueJ9O3DUi99CaUqT.okLT95GxgQP itUju9uNdkx.iebclHHbXfhjdAxG9Ocz5xbeypwaY8gcUvTx00lxZ_MOU_VKwtg.nqFDcPPeCHHc EmeKje7OmkiKGS4VFK1oPj23nP6R8v.GS23CfdW2vBHrq1U8XJGPwxAqyVTkBLHsVnPwDTb2EPoY wjEcF3_Fba8zg3xY_ZPj_Fz53zdUE.iXMQOvpCsmnBhl6CR4pILIy4RXuVgbdGH30Q7oQd3sdfVC dB.6pRpyxVvcUy6eLDNP.pRcXpipNhPxSGlCV35UMT0BxRTSmXwdQRX22x4J9CQTEGofls0dOS.z 8LyBINlOginxOXX0.F3yrButwAl3U68DUiwRc_YUCjnsNTHskhUZ8S38TUoVtcj8fHOEZPwK9_CH g8_KGzcg_V.ImZ16BATl8MAjOfmK9QoqJyUSwAJhOx5eV9F7IxcFvxQ4RTW7Tt76Bxvj7wBXuQCk njUJwvII8d5TqdO_o6NXsQNpJ3rSwMPm.yuo0D6atC X-Sonic-MF: X-Sonic-ID: a151bf5f-98e4-430b-b672-857fcd3653e7 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Mon, 3 Jun 2024 22:36:22 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-24wkz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b3ccbed966a62edff6a10c71e2d11fd3; Mon, 03 Jun 2024 22:36:19 +0000 (UTC) Content-Disposition: inline In-Reply-To: <8BC5E59B-63B1-4784-9454-51925E9DBCFC@gmail.com> X-Mailer: WebService/1.1.22407 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:286496 Archived-At: On Mon, Jun 03, 2024 at 06:22:48PM GMT, Mattias Engdeg�rd wrote: >3 juni 2024 kl. 17.28 skrev Eli Zaretskii : > >> The order of the patterns in the alist is a complete mystery to me. I >> tried to figure it out, but eventually gave up. A remark won't cut >> it, I think: we need a detailed description of the principles, >> considerations, and the way of testing the results after adding a new >> pattern. > >Yes, it's really not ideal. There are lots of legacy entries which are >hardly ever used and just shouldn't be there, or at least not enabled >by default. And as you say, the order is chaotic, difficult to >understand, and probably not the best. > About this, I may say that IMO the best approach is to use lazy insertion with-eval-after-load. For example, as I mentioned when I opened the issue: I have this in my init file: ``` (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))) ``` I use something similar for other build tools (like msbuild or incredibuild) in order to avoid performance impact. I also apply some tricks to reduce the compilation-error-regexp-alist when I know that only one pattern may apply in my cases. It may be amazing if we could simplify such customizations/optimizations somehow... >There is also insufficient testing of cross-pattern interference which >isn't easy or cheap to do if we are serious about it. > >The customisation interface is also not helping very much, and the >whole mechanism is not very modular. > >>> In fact the added pattern has visibly wrecked the display of etc/compilation.txt so I'm taking the slightly drastic step of reverting it. >> >> That succeeded in my testing, so I wonder why it doesn't work for you. > >My guess it is because of the nondeterministic parsing by >compilation-mode; it seems to depend on the order of fontification, and >possibly user settings (faces maybe). I can reproduce it reliably here, >though. > >Anyway, the syndrome was just a consequence of the previous >observations about the (far too unrestrained) regexp, so there is no >real mystery. > >> If you revert it, please fix this ASAP and install the results, since >> I'd like to have this on the emacs-20 branch, which will be cut >> soon-ish. > >Personally I strongly prefer no rule to a broken one, or even to >Mattias's-best-guess-of-what-a-correct-rule-might-look-like. >