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: Fri, 28 Feb 2020 18:11:21 +0100 Message-ID: <81FF6512-6E29-46F7-9AAD-324D915B3F2F@acm.org> References: 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="127146"; 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 Fri Feb 28 18:36:12 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 1j7jYa-000X0J-4L for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Feb 2020 18:36:12 +0100 Original-Received: from localhost ([::1]:51642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7jYZ-000468-55 for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Feb 2020 12:36:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34116) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7jAh-0004c0-IE for emacs-devel@gnu.org; Fri, 28 Feb 2020 12:11:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7jAg-0003TK-38 for emacs-devel@gnu.org; Fri, 28 Feb 2020 12:11:31 -0500 Original-Received: from mail1458c50.megamailservers.eu ([91.136.14.58]:57438 helo=mail267c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7jAf-0003Ps-Hi for emacs-devel@gnu.org; Fri, 28 Feb 2020 12:11:29 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1582909884; bh=ofJ7+yKqaZ2QdjBIamV3rle/+or1prNXpd/8m2+7QDE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=U2LvTTUa/JsVgIbIByNLFRAwfciHr91z+o0ZdhXmrpsGZ1K5fPrfjxysojxt9Ddmp RY8OVDSO15fEHrdgkBGVW3Zb9LmtKToE8sYpJygEnotnu+NKLyYFpIhqAEX0N85lsi tAVJuxgTxDT2He7TDsPlI0/VBxNWEDbSIV6wyVvA= 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 mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 01SHBMX6011575; Fri, 28 Feb 2020 17:11:23 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A782F1B.5E5949B9.00A8, 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=OY7m8SbY c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=Q4mlCgGn0itETf3B8LEA:9 a=KBYvba8H-dzS9d14:21 a=CNw6F2rI0itkG6pn:21 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.14.58 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:245108 Archived-At: 27 feb. 2020 kl. 19.17 skrev Filipp Gunbin : > Besides that, `java' symbol in the said list is a misnomer: it handles > java exceptions (why? we would never normally have them in the > compilation output), and valgrind output. Looks like we should just > rename it to `valgrind'. Maybe, but as you can see there are several questionably-named entries = in the list. Renaming them may break user customisation. As it is, it would be useful with a comment explaining the difference = between 'java' and 'javac' in the list. > + (javac > + ,(concat > + ;; line1 > + "^\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\): *" ;file > + "\\([0-9]+\\): *" ;line > + "\\(?:error:\\|\\(warning\\):\\)?[^\n]*\n" ;type (optional) = and message > + ;; line2: source line containing error > + "[^\n]*\n" > + ;; line3: single "^" under error position in line2 > + "[[:space:]]*\\^\n") (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.) Regexps in this list are good to keep tight; don't cast a net wider than = you have to. For instance, don't use " *" unless you know that there = may actually be any number of spaces. Most regexps here don't match; = optimise for that, rejecting false attempts as early as possible. Be = stingy. There's an unnecessary ambiguity after the line number and colon; a = string of spaces can match in multiple ways. Also, avoid [[:space:]] = since you don't control that syntax class in the buffer; more likely it = should just be plain spaces, as it's very unlikely that the javac caret = output routine would use anything else. > + 1 2 > + (lambda () If you add a comma before the lambda-expression, it gets evaluated, = byte-compiled, syntax-checked etc. > + ("/src/Test.java:5: ';' expected\n foo foo\n = ^\n" 1 15 5 "/src/Test.java" 2) > + ("e:\\src\\Test.java: 7: warning: ';' expected\n foo foo\n = ^\n" 1 10 7 "e:\\src\\Test.java" 1) Why the differences in spacing before the line number? Is it a = difference between platforms, error/warning, javac versions, or just = different compilers altogether? Comments explaining this would be = useful. Be sure to include variants in compilation.txt.