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: Wed, 1 Apr 2020 13:08:21 +0200 Message-ID: <63D0E806-FB67-459E-BAE0-300C4EACEFA0@acm.org> References: <81FF6512-6E29-46F7-9AAD-324D915B3F2F@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) 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="15685"; 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 Wed Apr 01 13:41:38 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 1jJbkY-0003yh-0v for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 13:41:38 +0200 Original-Received: from localhost ([::1]:58316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJbkW-0000Iu-VV for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 07:41:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37789) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJbjw-0008L0-UD for emacs-devel@gnu.org; Wed, 01 Apr 2020 07:41:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJbjv-0003ru-MP for emacs-devel@gnu.org; Wed, 01 Apr 2020 07:41:00 -0400 Original-Received: from mail1437c50.megamailservers.eu ([91.136.14.37]:60030 helo=mail263c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJbjv-0003qB-0G for emacs-devel@gnu.org; Wed, 01 Apr 2020 07:40:59 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1585739304; bh=+p9LVqHHr9DZiuY8whRfpn0dGrcB2p+n8y+GwCQrsRw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=EBm3PnbeVSLxCE2K5xn5DUWpNLt4CMDAgVLTWAo3HE44npMYxA6h9Oj4Ns/CGeVs7 OXcGDqecvyoSqsokUB0El7eX7fVitubuZt0H520UvUg6zf5bxPCQ75bUZgdJ/f/ADq P5fZ9fYmMI2KC3G1/FRZJkQGlVtuvNFEN2PFuvMs= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-6f4fe655.032-75-73746f71.bbcust.telenor.se [85.230.79.111]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 031B8MDa022020; Wed, 1 Apr 2020 11:08:23 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F28.5E84760F.0076, 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=e6d4tph/ c=1 sm=1 tr=0 a=fHaj9vQUQVKQ4sUldAaXuQ==:117 a=fHaj9vQUQVKQ4sUldAaXuQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=v5nN5ZtDzuoP0Ko7DWAA:9 a=mw511apQQpYRM6Ts:21 a=amp1qNTBtwELY5Bg: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.37 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:246185 Archived-At: 1 apr. 2020 kl. 02.34 skrev Filipp Gunbin : >> 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. >=20 > I didn't notice this because I do (set (make-local-variable > 'compilation-first-column) 0) in java-mode, but then other java rules > (ant, maven) may also be buggy, I'll look at this in more detail. (What java-mode are we talking about here? Some out-of-tree variant?) There should be no need to set compilation-first-column since the rule = does not match a column number directly but has to compute it using a = function. In fact, if you remove the change to that variable, the = function in the rule is neatly reduced from (lambda () (1- (current-column))) to just #'current-column This is also a benefit for other tools that use the same format, if any = -- scalac maybe? If you like, the same regexp in rx might be (rx bol ; line 1 (group-n 1 (? (in "A-Za-z") ":") ; file (+ (not (in "\n:")))) ":" (group-n 2 (+ digit)) ; line ": " (? (group-n 3 "warning: ")) ; optional warning type (* nonl) "\n" ; message (* nonl) "\n" ; line 2: source line (* " ") "^" eol) ; line 3: Single ^ under error = position Here group-n has been used to make the group numbering stand out for = extra clarity.