From unknown Sat Sep 06 03:53:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49624 <49624@debbugs.gnu.org> To: bug#49624 <49624@debbugs.gnu.org> Subject: Status: compilation message end-column function off-by-one bug Reply-To: bug#49624 <49624@debbugs.gnu.org> Date: Sat, 06 Sep 2025 10:53:14 +0000 retitle 49624 compilation message end-column function off-by-one bug reassign 49624 emacs submitter 49624 Mattias Engdeg=C3=A5rd severity 49624 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 15:00:56 2021 Received: (at submit) by debbugs.gnu.org; 18 Jul 2021 19:00:56 +0000 Received: from localhost ([127.0.0.1]:57288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5C24-0006Xy-00 for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:00:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:50514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5C21-0006VN-HA for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:00:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5C21-00018K-8L for bug-gnu-emacs@gnu.org; Sun, 18 Jul 2021 15:00:53 -0400 Received: from mail1435c50.megamailservers.eu ([91.136.14.35]:39356 helo=mail263c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5C1y-000647-BE for bug-gnu-emacs@gnu.org; Sun, 18 Jul 2021 15:00:52 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1626634844; bh=sKWMb2ADSEnIXXK8hgNgHWBREZw/cCHA2FthyP/be9I=; h=From:Subject:Date:Cc:To:From; b=bISQpHlk47kExlVOzSlEH2YdOjrE4CtxyPyLMT5TRGoS7jagIolIl9S5Kwk6m2Gf0 jD39Rf6dZoHkkFk5E4q0ffjtmYD5ptYhiLv1TrG6yTytS/U0/eOKSlV71Bq1gKvL47 wDxFUe4Os+uJL7JBBb6DtoC+7nHQgPghELQGY578= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 16IJ0fdP023241; Sun, 18 Jul 2021 19:00:43 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_516DFE37-6700-46E6-A593-4EECF868FE0F" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: compilation message end-column function off-by-one bug Message-Id: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> Date: Sun, 18 Jul 2021 21:00:41 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F2A.60F47A5C.004D, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=St3uF8G0 c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=RC2J-Ho0QuaG6yQqrC8A:9 a=CjuIK1q_8ugA:10 a=cJY3XOdKWCUBERfyV3wA:9 a=B2y7HmGcmWMA:10 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.35; envelope-from=mattiase@acm.org; helo=mail263c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Stefan Monnier , Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_516DFE37-6700-46E6-A593-4EECF868FE0F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Compilation message patterns (in compilation-regexp-alist and -alist) = can indicate starting and ending line and column numbers, either by = supplying regexp match numbers or functions that return the respective = line/column numbers when called. In other words, the integer N can be = understood as a shorthand for the function (lambda () (and (match-beginning N) (string-to-number (match-string = N)))) except that isn't true for the ending column where there is a difference = of 1; an END-COL function returning 13 means that the error's last = column is 12. There does not seem to be a good justification for this nor is it = documented so it's probably just a bug; proposed patch attached below. = Does it warrant a mention in etc/NEWS? --Apple-Mail=_516DFE37-6700-46E6-A593-4EECF868FE0F Content-Disposition: attachment; filename=0001-Fix-off-by-one-error-in-compilation-rule-end-column-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-off-by-one-error-in-compilation-rule-end-column-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20a2303f4651e225115207bad778024f913dc6dacb=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2018=20Jul=202021=2020:32:49=20+0200=0A= Subject:=20[PATCH]=20Fix=20off-by-one=20error=20in=20compilation=20rule=20= end-column=20function=0A=0A*=20lisp/progmodes/compile.el=20= (compilation-error-properties):=0AWhen=20the=20end-column=20parameter=20= of=20a=20compilation=20message=20rule=20is=0Aa=20function,=20treat=20its=20= return=20value=20the=20same=20way=20as=20textually=0Asupplied=20values=20= by=20adjusting=20both=20values=20in=20the=20same=20way.=0A---=0A=20= lisp/progmodes/compile.el=20=20=20=20=20=20=20=20=20=20=20=20|=2013=20= ++++++++-----=0A=20test/lisp/progmodes/compile-tests.el=20|=2027=20= +++++++++++++++++++++++++++=0A=202=20files=20changed,=2035=20= insertions(+),=205=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/compile.el=20b/lisp/progmodes/compile.el=0Aindex=20= e4363e11b8..02d1c58858=20100644=0A---=20a/lisp/progmodes/compile.el=0A= +++=20b/lisp/progmodes/compile.el=0A@@=20-1248,11=20+1248,14=20@@=20= compilation-error-properties=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(setq=20col=20(match-string-no-properties=20col))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-to-number=20col))))=0A= =20=20=20=20=20(setq=20end-col=0A-=20=20=20=20=20=20=20=20=20=20(or=20= (if=20(functionp=20end-col)=20(funcall=20end-col)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(and=20end-col=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(setq=20end-col=20= (match-string-no-properties=20end-col))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(-=20(string-to-number=20end-col)=20= -1)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20end-line=20= -1)))=0A+=20=20=20=20=20=20=20=20=20=20(let=20((ec=20(if=20(functionp=20= end-col)=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(funcall=20end-col)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(and=20end-col=20(match-beginning=20end-col)=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(string-to-number=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(match-string-no-properties=20= end-col))))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20(if=20ec=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(1+=20ec)=20=20=20=20=20;=20Add=20= one=20to=20get=20an=20exclusive=20upper=20bound.=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(and=20end-line=20-1))))=0A=20=20=20=20=20(if=20= (consp=20type)=20=20=20=20=20=20=20=20=20=20=20=20;=20not=20a=20static=20= type,=20check=20what=20it=20is.=0A=20=09(setq=20type=20(or=20(and=20(car=20= type)=20(match-end=20(car=20type))=201)=0A=20=09=09=20=20=20=20=20=20=20= (and=20(cdr=20type)=20(match-end=20(cdr=20type))=200)=0Adiff=20--git=20= a/test/lisp/progmodes/compile-tests.el=20= b/test/lisp/progmodes/compile-tests.el=0Aindex=200623cec528..2a3bb3dafa=20= 100644=0A---=20a/test/lisp/progmodes/compile-tests.el=0A+++=20= b/test/lisp/progmodes/compile-tests.el=0A@@=20-515,4=20+515,31=20@@=20= compile-test-grep-regexps=0A=20=20=20=20=20=20=20= (compile--test-error-line=20testcase))=0A=20=20=20=20=20(should=20(eq=20= compilation-num-errors-found=208))))=0A=20=0A+(ert-deftest=20= compile-test-functions=20()=0A+=20=20"Test=20rules=20using=20functions=20= instead=20of=20regexp=20group=20numbers."=0A+=20=20(let*=20((file-fun=20= (lambda=20()=20'("my-file")))=0A+=20=20=20=20=20=20=20=20=20= (line-start-fun=20(lambda=20()=20123))=0A+=20=20=20=20=20=20=20=20=20= (line-end-fun=20(lambda=20()=20134))=0A+=20=20=20=20=20=20=20=20=20= (col-start-fun=20(lambda=20()=2039))=0A+=20=20=20=20=20=20=20=20=20= (col-end-fun=20(lambda=20()=2024))=0A+=20=20=20=20=20=20=20=20=20= (compilation-error-regexp-alist-alist=0A+=20=20=20=20=20=20=20=20=20= `((my-rule=0A+=20=20=20=20=20=20=20=20=20=20=20=20,(rx=20bol=20"My=20= error=20message")=0A+=20=20=20=20=20=20=20=20=20=20=20=20,file-fun=0A+=20= =20=20=20=20=20=20=20=20=20=20=20(,line-start-fun=20.=20,line-end-fun)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(,col-start-fun=20.=20= ,col-end-fun))))=0A+=20=20=20=20=20=20=20=20=20= (compilation-error-regexp-alist=20'(my-rule)))=0A+=20=20= (with-temp-buffer=0A+=20=20=20=20(font-lock-mode=20-1)=0A+=20=20=20=20= (let=20((compilation-num-errors-found=200)=0A+=20=20=20=20=20=20=20=20=20= =20(compilation-num-warnings-found=200)=0A+=20=20=20=20=20=20=20=20=20=20= (compilation-num-infos-found=200))=0A+=20=20=20=20=20=20= (compile--test-error-line=0A+=20=20=20=20=20=20=20'(my-rule=0A+=20=20=20=20= =20=20=20=20=20"My=20error=20message"=0A+=20=20=20=20=20=20=20=20=201=20= (39=20.=2024)=20(123=20.=20134)=20"my-file"=202))=0A+=20=20=20=20=20=20= (should=20(eq=20compilation-num-errors-found=201))=0A+=20=20=20=20=20=20= (should=20(eq=20compilation-num-warnings-found=200))=0A+=20=20=20=20=20=20= (should=20(eq=20compilation-num-infos-found=200))))))=0A+=0A=20;;;=20= compile-tests.el=20ends=20here=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_516DFE37-6700-46E6-A593-4EECF868FE0F-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 15:10:41 2021 Received: (at 49624) by debbugs.gnu.org; 18 Jul 2021 19:10:41 +0000 Received: from localhost ([127.0.0.1]:57321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CBV-00088I-EQ for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:10:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CBF-00087q-0w for 49624@debbugs.gnu.org; Sun, 18 Jul 2021 15:10:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49524) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5CB8-00041R-LZ; Sun, 18 Jul 2021 15:10:19 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1876 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5CB1-0004zp-ER; Sun, 18 Jul 2021 15:10:18 -0400 Date: Sun, 18 Jul 2021 22:10:05 +0300 Message-Id: <83h7gr781e.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sun, 18 Jul 2021 21:00:41 +0200) Subject: Re: bug#49624: compilation message end-column function off-by-one bug References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias EngdegÄrd > Date: Sun, 18 Jul 2021 21:00:41 +0200 > Cc: Stefan Monnier , Juri Linkov > > Compilation message patterns (in compilation-regexp-alist and -alist) can indicate starting and ending line and column numbers, either by supplying regexp match numbers or functions that return the respective line/column numbers when called. In other words, the integer N can be understood as a shorthand for the function > > (lambda () (and (match-beginning N) (string-to-number (match-string N)))) > > except that isn't true for the ending column where there is a difference of 1; an END-COL function returning 13 means that the error's last column is 12. Isn't that because END-COL is the first column _beyond_ the last column? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 15:13:44 2021 Received: (at 49624) by debbugs.gnu.org; 18 Jul 2021 19:13:44 +0000 Received: from localhost ([127.0.0.1]:57348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CES-0008Ec-85 for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:13:44 -0400 Received: from mail235c50.megamailservers.eu ([91.136.10.245]:50782 helo=mail56c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CEP-0008ER-Ro for 49624@debbugs.gnu.org; Sun, 18 Jul 2021 15:13:43 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1626635619; bh=LLRESYwPTsG6TFIYvnY3qhgVPFZ10HCItovINHjLxIw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=nNkHHHDBzQ/XHBLo6WJ4HJSjF8MwYJkG7DvlhupRk74zjszyLR34UNn8aB/7wUVeZ uUah85zRmQZgjmIWY4LicMY64gpbXZ9rNd2+KaJClJYXn1Ov3gfVB61ieVwthsbi1R v5Afh1QkFd0jUxh1q5Yo6ROAFK0k38J5NXme3y4c= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 16IJDbQs031818; Sun, 18 Jul 2021 19:13:38 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: bug#49624: compilation message end-column function off-by-one bug From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83h7gr781e.fsf@gnu.org> Date: Sun, 18 Jul 2021 21:13:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F28.60F47D63.0028, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=F5gpiZpN c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=6a8BSRyKGa04qh0KSXQA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 18 juli 2021 kl. 21.10 skrev Eli Zaretskii : > Isn't that because END-COL is the first column _beyond_ the last > column? Yes, that is probably the origin of the bug. However as that is just the internal representation (column range as a half-open interval) it should not be visible to the user. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 18 juli 2021 kl. 21.10 skrev Eli Zaretskii : > Isn't that because END-COL is the first column _beyond_ the last > column? Yes, that is probably the origin of the bug. However as that is just the = internal representation (column range as a half-open interval) it should = not be visible to the user. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 15:30:39 2021 Received: (at 49624) by debbugs.gnu.org; 18 Jul 2021 19:30:39 +0000 Received: from localhost ([127.0.0.1]:57415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CUo-0002T6-Rs for submit@debbugs.gnu.org; Sun, 18 Jul 2021 15:30:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5CUn-0002Sq-Hu for 49624@debbugs.gnu.org; Sun, 18 Jul 2021 15:30:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49896) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5CUh-0001Ff-Db; Sun, 18 Jul 2021 15:30:31 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3114 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5CUf-0008KU-8K; Sun, 18 Jul 2021 15:30:30 -0400 Date: Sun, 18 Jul 2021 22:30:23 +0300 Message-Id: <83czrf773k.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sun, 18 Jul 2021 21:13:36 +0200) Subject: Re: bug#49624: compilation message end-column function off-by-one bug References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Feedback-ID:mattiase@acm.or > From: Mattias EngdegÄrd > Date: Sun, 18 Jul 2021 21:13:36 +0200 > Cc: 49624@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net > > 18 juli 2021 kl. 21.10 skrev Eli Zaretskii : > > > Isn't that because END-COL is the first column _beyond_ the last > > column? > > Yes, that is probably the origin of the bug. However as that is just the internal representation (column range as a half-open interval) it should not be visible to the user. ??? Why not? From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 19 06:40:09 2021 Received: (at 49624) by debbugs.gnu.org; 19 Jul 2021 10:40:09 +0000 Received: from localhost ([127.0.0.1]:58094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Qgz-0005O6-D8 for submit@debbugs.gnu.org; Mon, 19 Jul 2021 06:40:09 -0400 Received: from mail238c50.megamailservers.eu ([91.136.10.248]:36520 helo=mail56c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Qgv-0005Nt-Tj for 49624@debbugs.gnu.org; Mon, 19 Jul 2021 06:40:07 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1626691203; bh=AcRhxDWD9ghSKhmoTym5cBvrKM3/9W3rsIFymQ3l5RQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=jwGubIUj3D2klf7qITVypQOLWE3D00fVFQRcbWMVl7zZkSJX4WMNP1ZPn8fGsKizY ChW0zFOeFfgqAJWffR8MqMx9kwtMGOJW6sS7NYgTfksa1aF0GZq3x768kwb0gbro/E +F7TDVNNYNP9w5UhbCqgw0fgRkqWyINHdrfz70po= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 16JAdxVM011425; Mon, 19 Jul 2021 10:40:01 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: bug#49624: compilation message end-column function off-by-one bug From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83czrf773k.fsf@gnu.org> Date: Mon, 19 Jul 2021 12:39:59 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <5FDA92A6-421D-4A91-A2D9-D0101B115037@acm.org> References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> <83czrf773k.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F16.60F55683.002A, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=F5gpiZpN c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=3ZqT2bJ5xEExwQNHnS0A:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 18 juli 2021 kl. 21.30 skrev Eli Zaretskii : > ??? Why not? Not sure what you mean (and I don't really think it's something we disagree about) but in any case it's beside the point. Emacs should behave as expected by the user, as documented, and in a consisten [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 18 juli 2021 kl. 21.30 skrev Eli Zaretskii : > ??? Why not? Not sure what you mean (and I don't really think it's something we = disagree about) but in any case it's beside the point. Emacs should = behave as expected by the user, as documented, and in a consistent way. = Currently it does neither. The more I think about it, the clearer it becomes that it's a plain bug = which I'm making too much fuss about and should just go ahead and fix = the stupid thing. It was mainly reported on the unlikely chance that = Juri and/or Stefan would remember something interesting about the code, = but that's secondary. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 23 09:25:10 2021 Received: (at 49624-done) by debbugs.gnu.org; 23 Jul 2021 13:25:10 +0000 Received: from localhost ([127.0.0.1]:42603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6vAs-0004vg-8H for submit@debbugs.gnu.org; Fri, 23 Jul 2021 09:25:10 -0400 Received: from mail1473c50.megamailservers.eu ([91.136.14.73]:59580 helo=mail102c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6vAo-0004v3-DK for 49624-done@debbugs.gnu.org; Fri, 23 Jul 2021 09:25:09 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1627046699; bh=niRlsGtDaGZ1lg6PXvc6zcX/5wFzDZaUY+bufJWbeLg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=YqzjymjDRdYC8ytFMfFwBxekEo2eev4SkAAmTpcW9XjZud4K8/we3odq6vMVBp5sU uOiWoxfIGVGCF/di5xsXCNyia09+ZF7/4Acq0Y850CpBWrW1MDKqyp5AzlY3C+j+Rt DRuH16XC9LEB+bQH9Iis0i0Q9peulVif3YleCa8I= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail102c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 16NDOtpv008859; Fri, 23 Jul 2021 13:24:57 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: bug#49624: compilation message end-column function off-by-one bug From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <87pmvevv28.fsf@mail.linkov.net> Date: Fri, 23 Jul 2021 15:24:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <71FBE546-8821-497D-83A9-A6E4CF0BBBA3@acm.org> References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> <83czrf773k.fsf@gnu.org> <5FDA92A6-421D-4A91-A2D9-D0101B115037@acm.org> <875yx6qtwg.fsf@mail.linkov.net> <5BAAD7D4-A578-4DB5-925E-ECE02B4F4B56@acm.org> <87pmvevv28.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F26.60FAC32B.0008, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Z/WS40ZA c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=ucMQw-l_AAAA:8 a=b-MxgrIscPTMqcxDO28A:9 a=CjuIK1q_8ugA:10 a=xkTruGkd22MpkFU079mG:22 X-Origin-Country: SE X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 49624-done Cc: 49624-done@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 19 juli 2021 kl. 23.43 skrev Juri Linkov : >> Not even 9dc3a46a444a46e00ed3287a3174d73ed9511dac where the funcall = for col and end-col originated? >> In any case, no worry -- I'll deal with it. >=20 > My apologies. This commit is so old that I even don't recognize it. > I need to study this code again since I don't remember this part > of compile.el. Thank you, but it's not that important. Let's not overthink it -- I'm = treating it as the bug it is and have pushed the obvious fix to master. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 26 13:17:32 2021 Received: (at 49624) by debbugs.gnu.org; 26 Jul 2021 17:17:32 +0000 Received: from localhost ([127.0.0.1]:51433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m84EO-0000gB-Ff for submit@debbugs.gnu.org; Mon, 26 Jul 2021 13:17:32 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:40799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m84EL-0000fw-SQ for 49624@debbugs.gnu.org; Mon, 26 Jul 2021 13:17:31 -0400 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BE65FFF805; Mon, 26 Jul 2021 17:17:21 +0000 (UTC) From: Juri Linkov To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= Subject: Re: bug#49624: compilation message end-column function off-by-one bug Organization: LINKOV.NET References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> <83czrf773k.fsf@gnu.org> <5FDA92A6-421D-4A91-A2D9-D0101B115037@acm.org> <875yx6qtwg.fsf@mail.linkov.net> <5BAAD7D4-A578-4DB5-925E-ECE02B4F4B56@acm.org> <87pmvevv28.fsf@mail.linkov.net> <71FBE546-8821-497D-83A9-A6E4CF0BBBA3@acm.org> Date: Mon, 26 Jul 2021 20:06:20 +0300 In-Reply-To: <71FBE546-8821-497D-83A9-A6E4CF0BBBA3@acm.org> ("Mattias =?iso-8859-1?Q?Engdeg=E5rd=22's?= message of "Fri, 23 Jul 2021 15:24:55 +0200") Message-ID: <87h7ghku9w.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> Not even 9dc3a46a444a46e00ed3287a3174d73ed9511dac >>> where the funcall for col and end-col originated? >>> In any case, no worry -- I'll deal with it. >> >> My apologies. This commit is so old that I even don't recognize it. >> I need to study this code again since I don't remember this part >> of compile.el. > > Thank you, but it's not that important. Let's not overthink it -- I'm > treating it as the bug it is and have pushed the obvious fix to master. I'm terribly sorry that it took so much time for me to realize that my commit 9dc3a46a444a46e00ed3287a3174d73ed9511dac was part of efforts to add column information to grep matches, also I needed to inspect the history of column-related code in compile.el to understand the reason of incrementing the value of end-col. Here are my findings: The commit c0090c20f88d1e8c99e9823db5b9cc25d98672bc with the log message (compilation-error-properties): Store one more than end-col, if present, so that transient-mark-mode will highlight last char too. turned an exclusive upper bound (e.g. [4, 6) that highlighted 2 chars) into an inclusive upper bound (e.g. [4, 6] that highlighted 3 chars) on the assumption that most compilation tools report inclusive ranges. Then without changing this logic in 9dc3a46a444a46e00ed3287a3174d73ed9511dac I added a funcall without incrementing its result by 1 on the assumption that the function can return an already inclusive result that doesn't need to offset by 1. Now your commit aa5437493b1ca539409495ecdc54cf420ea110b9 broke the highlighting of columns in grep-regexp-alist, so now visiting a grep match highlights an additional character that is not part of the grep match. Maybe there are more existing functions whose backward-compatibility is broken now. For example, (javac ,... 1 2 ,#'current-column (3)) uses ,#'current-column although not for end-col, so it's not affected. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 26 15:31:11 2021 Received: (at 49624) by debbugs.gnu.org; 26 Jul 2021 19:31:12 +0000 Received: from localhost ([127.0.0.1]:51543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m86Jh-00069z-AI for submit@debbugs.gnu.org; Mon, 26 Jul 2021 15:31:11 -0400 Received: from mail1433c50.megamailservers.eu ([91.136.14.33]:35452 helo=mail263c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m86Jc-00069Q-JH for 49624@debbugs.gnu.org; Mon, 26 Jul 2021 15:31:08 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1627327857; bh=2p47vnly8TO9CTQnUNx9vG7V+eeQGpExzJPqXWqk4/4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=YJLObWMu/me7vcEeTgiyraEIrR6GWU3HjxdfGWWaKQHr16xXpuztenci7f53YNi0p 8rVT6yOPotRm/zhvUw7DGgo3hldVJcTtIknzNfGOveA5hvguTkACC98E9vLc6H2dYg rRuJzTyJQvXBRSZVxqeodKugL5jElWUKiAGuuNc0= Feedback-ID: mattiase@acm.or Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 16QJUsU5025904; Mon, 26 Jul 2021 19:30:56 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: bug#49624: compilation message end-column function off-by-one bug From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <87h7ghku9w.fsf@mail.linkov.net> Date: Mon, 26 Jul 2021 21:30:53 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <55B887CA-7259-43C8-89B2-53FE25AC3F5F@acm.org> References: <462A3B1B-6632-4740-907D-03B67377452E@acm.org> <83h7gr781e.fsf@gnu.org> <83czrf773k.fsf@gnu.org> <5FDA92A6-421D-4A91-A2D9-D0101B115037@acm.org> <875yx6qtwg.fsf@mail.linkov.net> <5BAAD7D4-A578-4DB5-925E-ECE02B4F4B56@acm.org> <87pmvevv28.fsf@mail.linkov.net> <71FBE546-8821-497D-83A9-A6E4CF0BBBA3@acm.org> <87h7ghku9w.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F1D.60FF0D71.002D, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=St3uF8G0 c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=ucMQw-l_AAAA:8 a=qxnCptG8Fm4groZ4cgEA:9 a=CjuIK1q_8ugA:10 a=xkTruGkd22MpkFU079mG:22 X-Origin-Country: SE X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 26 juli 2021 kl. 19.06 skrev Juri Linkov : > my commit 9dc3a46a444a46e00ed3287a3174d73ed9511dac > was part of efforts to add column information to grep matches, > I added a funcall without incrementing its result by 1 > on the assumption that the function can return > an already inclusive result that doesn't need to offset by 1. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 49624 Cc: 49624@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 26 juli 2021 kl. 19.06 skrev Juri Linkov : > my commit 9dc3a46a444a46e00ed3287a3174d73ed9511dac > was part of efforts to add column information to grep matches, > I added a funcall without incrementing its result by 1 > on the assumption that the function can return > an already inclusive result that doesn't need to offset by 1. Thank you for the thorough investigation! > Now your commit aa5437493b1ca539409495ecdc54cf420ea110b9 > broke the highlighting of columns in grep-regexp-alist, > so now visiting a grep match highlights an additional character > that is not part of the grep match. Good spotting! That one has now been fixed. > Maybe there are more existing functions whose backward-compatibility > is broken now. In preparation of my change I went through lots and lots of external = packages and found exactly none using a function for END-COL. This is = unsurprising since the very ability to use functions for COL and END-COL = wasn't documented until 2019. Somehow I missed grep.el, but that too makes sense -- it's inside Emacs = itself that the feature was most likely to be used since it was = undocumented. I have now gone through the source tree once more, and = there seem to be no more problems. From unknown Sat Sep 06 03:53:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 24 Aug 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator