From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Review request: javac in compilation-error-regexp-alist-alist Date: Sat, 29 Feb 2020 11:58:05 +0100 Message-ID: References: <81FF6512-6E29-46F7-9AAD-324D915B3F2F@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="114483"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Filipp Gunbin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 29 11:58:47 2020 Return-path: Envelope-to: ged-emacs-devel@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 1j7zpW-000The-Tw for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Feb 2020 11:58:46 +0100 Original-Received: from localhost ([::1]:59288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7zpV-0000f9-UR for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Feb 2020 05:58:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50633) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7zp1-0000Ej-5x for emacs-devel@gnu.org; Sat, 29 Feb 2020 05:58:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7zoz-0000d5-R2 for emacs-devel@gnu.org; Sat, 29 Feb 2020 05:58:14 -0500 Original-Received: from mail213c50.megamailservers.eu ([91.136.10.223]:49516 helo=mail194c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7zoz-0000cL-Ag for emacs-devel@gnu.org; Sat, 29 Feb 2020 05:58:13 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1582973888; bh=MrdJEVVn//pd/ud7MW4AtTHg9cAParzIC0tDXtxncpg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=ektbtVXu4Daoso8nXfg+2ZUBWAEi/dRct1nglHp7YUf5htpzzR5fQjXqyPQ1z8Lyv E3aXIJxQTNLoEn/n6tap+WorUEUyx+NDgyrUwfnTmtlbDgyfkhIzlJ/3ciKYbQMCc2 GZ5S4H6EtoZ6kZus1xLuYCVuxYpdkJxnLp5NEw8A= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 01TAw5pC015348; Sat, 29 Feb 2020 10:58:07 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A782F1C.5E5A43BE.0034, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=A9kSwJeG c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=_QS9N15CxZ4Ei6OkGT8A:9 a=CjuIK1q_8ugA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.223 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245118 Archived-At: 29 feb. 2020 kl. 00.02 skrev Filipp Gunbin : >> (Could I entice you into writing this regexp in rx? Not mandatory in >> any way, but at least some of us who read it will thank you.) >=20 > I'm not experienced with it yet, but noted, will do later. It's entirely optional. You could try the 'xr' package to help you = translate. > + (javac > + ,(concat > + ;; line1 > + "^\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\):" ;file > + "\\([0-9]+\\): " ;line > + "\\(?:\\(?:error\\|\\(warning\\)\\): \\)?[^\n]*\n" ;type = (optional) and message Thank you, much better. You may want to use '.' instead of '[^\n]'; they = mean exactly the same thing. There is also no need to match "error" specifically; "\\(warning: \\)?" = suffices. > + ;; line2: source line containing error > + "[^\n]*\n" > + ;; line3: single "^" under error position in line2 > + " *\\^\n") > + 1 2 > + ,(lambda () > + (save-excursion > + (backward-char 2) ; move back over "^\n" > + (current-column))) There seems to be an off-by-one error in the column number; try it and = you'll see. I think current-column is 0-based but Emacs expects a = 1-based column from the compilation error matcher. A minor bug (probably in compilation-mode) is that the mouse = highlighting includes the first character of the line following the = caret line. To avoid this, try replacing the final '\n' with '$'. As an = extra benefit, the need for save-excursion and backward-char would go = away. This rule does present some performance concerns (perhaps unfounded): = the first line, the "file:line: message" part, is likely to match many = non-java messages. The entire next line is then matched regardless of = contents, and the missing caret finally causes backtracking. I'm not = sure how serious this is, or what can be done about it.