From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#40119: [PATCH] Make compilation-mode regexp matching case-sensitive Date: Wed, 18 Mar 2020 23:05:25 +0100 Message-ID: <746AEDAD-CA83-4B11-BF31-681C764A6E3D@acm.org> References: <837B3AF9-46ED-415A-BDFE-251BD97ECBB8@acm.org> <83eetpfsj0.fsf@gnu.org> <94F606C0-31BE-4BF3-84B3-64F8BAAF7A58@acm.org> <837dzhfomi.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_6EC20CF3-C251-4170-84A6-C2E2BC308147" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="61618"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40119@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 18 23:06:15 2020 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 1jEgpJ-000FrW-OH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Mar 2020 23:06:13 +0100 Original-Received: from localhost ([::1]:58880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEgpI-0004pw-G3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Mar 2020 18:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEgp9-0004pm-Bc for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 18:06:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEgp8-00086F-AI for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 18:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEgp8-00085u-6j for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 18:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jEgp8-0002Sg-0n for bug-gnu-emacs@gnu.org; Wed, 18 Mar 2020 18:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Mar 2020 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40119 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40119-submit@debbugs.gnu.org id=B40119.15845691379424 (code B ref 40119); Wed, 18 Mar 2020 22:06:01 +0000 Original-Received: (at 40119) by debbugs.gnu.org; 18 Mar 2020 22:05:37 +0000 Original-Received: from localhost ([127.0.0.1]:41530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEgoj-0002Rw-Ca for submit@debbugs.gnu.org; Wed, 18 Mar 2020 18:05:37 -0400 Original-Received: from mail1453c50.megamailservers.eu ([91.136.14.53]:51796 helo=mail266c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEgoh-0002Rb-1q for 40119@debbugs.gnu.org; Wed, 18 Mar 2020 18:05:36 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1584569128; bh=DVqmnyiPUk06KiM0WKI9p9W8XdGykTaLt9ItHHOzP0g=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=jn5G4yqINv/usZ12fOMpOcZRa7IzcH+Fi2VV2+OOjjuBfy5g7ZM2qfmafIDGx3xOU +Gf9a8m+5r5keWhMokuDtnq2cujRqTj518G7bY6KxQMR+OLU7yWVfWFWZFZQknriNX sm37OM953068aO40tB+j+wNoji9fD4WfCpO5bzJ4= 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 mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 02IM5PEa021466; Wed, 18 Mar 2020 22:05:27 +0000 In-Reply-To: <837dzhfomi.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A782F17.5E729B11.0013, 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=A5MSwJeG c=1 sm=1 tr=0 a=fHaj9vQUQVKQ4sUldAaXuQ==:117 a=fHaj9vQUQVKQ4sUldAaXuQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=t6krDi3gn9OLLF31zwwA:9 a=CjuIK1q_8ugA:10 a=SRWi5YXmmYlpjXgHlRYA:9 a=B2y7HmGcmWMA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:177525 Archived-At: --Apple-Mail=_6EC20CF3-C251-4170-84A6-C2E2BC308147 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 18 mars 2020 kl. 20.29 skrev Eli Zaretskii : > What I meant is that some of > the rules were written _knowing_ that the match is case-insensitive, > and will fail to match if that is changed. I don't think there's > anyone around here that can claim detailed knowledge of every rule and > the compiler(s) that use them, so we have no one to ask whether this > danger is real or imaginary. Thank you for clarifying! All the tests pass after the change, and = etc/compilation.txt is rendered almost identically. There is only one = difference: the example for 'watcom' did not actually match that rule, = but rule 'edg-1' (which comes earlier in the list) instead. With = case-fold-search set to nil, the 'watcom' example is matched by its rule = and not by edg-1. In other words, it is unlikely that the existing rules in compile.el = expect case-insensitive matching of the output for which they are = written. Conversely, there is already evidence that case-insensitive = matching causes the wrong rule to be used. Of course we cannot exclude that rules are used with compilers other = than for which the patterns were designed. The correct way to handle = this should be to add a suitable rule, not to change how all rules = match. Nevertheless, I added a user switch to turn case-insensitivity = back on again for those who prefer it that way. Revised patch follows. --Apple-Mail=_6EC20CF3-C251-4170-84A6-C2E2BC308147 Content-Disposition: attachment; filename=0001-Make-compilation-mode-regexp-matching-case-sensitive.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Make-compilation-mode-regexp-matching-case-sensitive.patch" Content-Transfer-Encoding: quoted-printable =46rom=20311d51e33d290c7d28147dfd3a1701964f102ad3=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Wed,=2018=20Mar=202020=2016:01:02=20+0100=0A= Subject:=20[PATCH]=20Make=20compilation-mode=20regexp=20matching=20= case-sensitive=0A=0AThe=20number=20of=20regexps=20is=20large,=20they=20= are=20often=20written=20independently=0Aof=20one=20another,=20and=20they=20= frequently=20intersect.=20=20Using=20case-sensitive=0Amatching=20= improves=20separation=20and=20performance,=20and=20is=20probably=20what=0A= everyone=20have=20being=20assuming=20all=20along.=0A=0A*=20= lisp/progmodes/compile.el=20(compilation-error-case-fold-search):=20New.=0A= *=20lisp/progmodes/compile.el=20(compilation-parse-errors):=0ABind=20= case-fold-search=20to=20compilation-error-case-fold-search=20during=20= matching.=0A*=20etc/NEWS:=20Announce.=0A---=0A=20etc/NEWS=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20|=20=206=20++++++=0A=20= lisp/progmodes/compile.el=20|=2011=20++++++++++-=0A=202=20files=20= changed,=2016=20insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/etc/NEWS=20b/etc/NEWS=0Aindex=2087e634f2c1..14a4bb4891=20100644=0A---=20= a/etc/NEWS=0A+++=20b/etc/NEWS=0A@@=20-174,6=20+174,12=20@@=20key=20=20=20= =20=20=20=20=20=20=20=20=20=20binding=0A=20/=20v=20=20=20=20=20=20=20=20=20= =20=20=20=20package-menu-filter-by-version=0A=20/=20/=20=20=20=20=20=20=20= =20=20=20=20=20=20package-menu-filter-clear=0A=20=0A+**=20Compilation=20= mode=0A+=0A+***=20Regexp=20matching=20of=20messages=20is=20now=20= case-sensitive=20by=20default.=0A+The=20user=20option=20= 'compilation-error-case-fold-search'=20can=20be=20set=0A+for=20= case-insensitive=20matching=20of=20messages.=0A+=0A=20=0C=0A=20*=20New=20= Modes=20and=20Packages=20in=20Emacs=2028.1=0A=20=0Adiff=20--git=20= a/lisp/progmodes/compile.el=20b/lisp/progmodes/compile.el=0Aindex=20= 455f181f50..f4532b7edb=20100644=0A---=20a/lisp/progmodes/compile.el=0A= +++=20b/lisp/progmodes/compile.el=0A@@=20-646,6=20+646,14=20@@=20= compilation-error-regexp-alist=0A=20=20=20:link=20`(file-link=20:tag=20= "example=20file"=0A=20=09=09=20=20=20=20,(expand-file-name=20= "compilation.txt"=20data-directory)))=0A=20=0A+(defcustom=20= compilation-error-case-fold-search=20nil=0A+=20=20"If=20non-nil,=20use=20= case-insensitive=20matching=20of=20compilation=20errors=0A+by=20the=20= regexps=20of=20`compilation-error-regexp-alist'=20and=0A= +`compilation-error-regexp-alist-alist'.=0A+If=20nil,=20matching=20is=20= case-sensitive."=0A+=20=20:type=20'boolean=0A+=20=20:version=20"28.1")=0A= +=0A=20;;;###autoload(put=20'compilation-directory=20= 'safe-local-variable=20'stringp)=0A=20(defvar=20compilation-directory=20= nil=0A=20=20=20"Directory=20to=20restore=20to=20when=20doing=20= `recompile'.")=0A@@=20-1435,7=20+1443,8=20@@=20compilation-parse-errors=0A= =20=20=20=20=20(if=20(symbolp=20item)=0A=20=20=20=20=20=20=20=20=20(setq=20= item=20(cdr=20(assq=20item=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= compilation-error-regexp-alist-alist))))=0A-=20=20=20=20(let=20((file=20= (nth=201=20item))=0A+=20=20=20=20(let=20((case-fold-search=20= compilation-error-case-fold-search)=0A+=20=20=20=20=20=20=20=20=20=20= (file=20(nth=201=20item))=0A=20=20=20=20=20=20=20=20=20=20=20(line=20= (nth=202=20item))=0A=20=20=20=20=20=20=20=20=20=20=20(col=20(nth=203=20= item))=0A=20=20=20=20=20=20=20=20=20=20=20(type=20(nth=204=20item))=0A--=20= =0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_6EC20CF3-C251-4170-84A6-C2E2BC308147--