GNU bug report logs - #57883
compilation-get-file-structure mishandles buffers

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: JD Smith <jdtsmith@HIDDEN>; Keywords: moreinfo; dated Sat, 17 Sep 2022 14:26:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 57883 <at> debbugs.gnu.org:


Received: (at 57883) by debbugs.gnu.org; 18 Sep 2022 10:55:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 06:55:57 2022
Received: from localhost ([127.0.0.1]:47953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZrxt-0007H3-3a
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 06:55:57 -0400
Received: from quimby.gnus.org ([95.216.78.240]:37854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oZrxr-0007Gm-KE
 for 57883 <at> debbugs.gnu.org; Sun, 18 Sep 2022 06:55:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=9iDZOWxBK68T0e65hvNvcK3CY/HrmszS9os+XQxXc3U=; b=It0MlU975UQp+NP8c9a25vJJGW
 NaOHW8k6LyDcofbReBQYwyCOSQscPzHByW4D7l/YaCW8LrtMHyV2J0RBlhhbr0sP/AcfYQjjtpUyz
 kRLu7UTRjmhwlhR3ugpGdlEWSk3aHXvwtAmiGAkMSQv9euoAPYmsouXCdx/vUCyxk6M4=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oZrxj-0006wN-Ra; Sun, 18 Sep 2022 12:55:49 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: JD Smith <jdtsmith@HIDDEN>
Subject: Re: bug#57883: compilation-get-file-structure mishandles buffers
In-Reply-To: <DBE4B6AE-272F-47FF-8623-C314C0E8FD32@HIDDEN> (JD Smith's
 message of "Sat, 17 Sep 2022 10:25:25 -0400")
References: <DBE4B6AE-272F-47FF-8623-C314C0E8FD32@HIDDEN>
X-Now-Playing: Stephan Mathieu's _Radiance (12): Pacific_: "Pacific"
Date: Sun, 18 Sep 2022 12:55:45 +0200
Message-ID: <87edw93qa6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.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
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  JD Smith <jdtsmith@HIDDEN> writes: > Note that this is
   useful for modes which report errors in text from open buffers, which > may
    have no associated file. The issue is this line in `compilation-get-file-structure’:
    > > (if (file-nam [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57883
Cc: 57883 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

JD Smith <jdtsmith@HIDDEN> writes:

> Note that this is useful for modes which report errors in text from open =
buffers, which
> may have no associated file.   The issue is this line in `compilation-get=
-file-structure=E2=80=99:
>
> (if (file-name-absolute-p filename)=20
>    (setq filename (concat comint-file-name-prefix filename)))=20
> which signals an=20

This is how your email ended, so I think your message may have been cut
off?

In any case, do you have a recipe to reproduce the problem, starting
from "emacs -Q"?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57883; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Sep 2022 14:25:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 17 10:25:37 2022
Received: from localhost ([127.0.0.1]:46920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZYlE-0000jG-O1
	for submit <at> debbugs.gnu.org; Sat, 17 Sep 2022 10:25:37 -0400
Received: from lists.gnu.org ([209.51.188.17]:40192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jdtsmith@HIDDEN>) id 1oZYl9-0000j5-Nk
 for submit <at> debbugs.gnu.org; Sat, 17 Sep 2022 10:25:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51620)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1oZYl9-0000hX-IZ
 for bug-gnu-emacs@HIDDEN; Sat, 17 Sep 2022 10:25:31 -0400
Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:44723)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jdtsmith@HIDDEN>)
 id 1oZYl7-0001Xe-Ua
 for bug-gnu-emacs@HIDDEN; Sat, 17 Sep 2022 10:25:31 -0400
Received: by mail-io1-xd36.google.com with SMTP id d8so16597158iof.11
 for <bug-gnu-emacs@HIDDEN>; Sat, 17 Sep 2022 07:25:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=to:date:message-id:subject:mime-version:from:from:to:cc:subject
 :date; bh=jG/b4LgmK1Hnzcja9cTKx2wa6iP33TbmhMuttAyHJDM=;
 b=CMr5M09FCKvh3e+WqKWVIuTn/BVEH8Soajnhxp8oTvjEaB753t57gSwEWtYRvRBwJQ
 H/Dqq4x5ADUa87HBsGO+gUmMoyPV44fjm/x5ujTMyedU7C1TQ7Q2zI88qUtdghT/vn6H
 yNncWWf7FC2j6cwoU++mYC4HquWbc6S2ihMdhdJmiC/L96lDktQqFXNdOO5LJfJpk91C
 eCMMAhdvOiRuqRxxix/QzCWCpIBrpEZV3Ev2EedqaQL8e6Ob8fai2oEBJzozGkmKe21H
 iLxh+FRFRqG3DOoQxMM4kYkMl/9tRCPr1EZ9wC41HRlMjnhLPHN4p8+BTO/nb2SLfwel
 z+Eg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:date:message-id:subject:mime-version:from:x-gm-message-state
 :from:to:cc:subject:date;
 bh=jG/b4LgmK1Hnzcja9cTKx2wa6iP33TbmhMuttAyHJDM=;
 b=ViPrcAdo+5Huwh4daR9x5HWh/1rlZl1vC38fqn+eUt4Ns0sHLHhrD5XKh6kvygcy/N
 EifOTIdG8GeGW5FWzzdQ8ezdDX0TcYr68x4QqIlNFKjYaZqNTbVhWe9Ziu5zNKldyguK
 zGdUXuocPAGsS5PI8KZS0IyilRf8eSY1jqZaQkUz2GgDX+3bsV3My7C2vguY1MDJjfsP
 E1xCvsgoFERcb0uy4x6IaYIC0qbrECWHcxT/CwTAJjVtDFCOr25ZV7jhyO754fQuPqSX
 Friva5DddbE25OTzW2tipWe0Bn8D4Y/0+bflaK59sqqM5A4zEmDwpm1xtIxMGhR95bW7
 zp+w==
X-Gm-Message-State: ACrzQf0BaL2LFYW2FEMgC7Q/mpRklgy02uFQW0RbvkZAw4KwRxzqmGFy
 h4/wDsN78ktBw32D2GjmmYPj36XKXHw=
X-Google-Smtp-Source: AMsMyM6XzJcIyrt43WCD1PpBZqMH6U0nvOoHSt/YVIEm92aj+9HEXROyDq4SQ4Sw18U7QvIFfFc61A==
X-Received: by 2002:a05:6638:2644:b0:35a:9af1:e491 with SMTP id
 n4-20020a056638264400b0035a9af1e491mr2746265jat.258.1663424728086; 
 Sat, 17 Sep 2022 07:25:28 -0700 (PDT)
Received: from smtpclient.apple (cm-24-53-184-207.buckeyecom.net.
 [24.53.184.207]) by smtp.gmail.com with ESMTPSA id
 c8-20020a92c8c8000000b002f4e6fe33ddsm1786851ilq.84.2022.09.17.07.25.26
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 17 Sep 2022 07:25:27 -0700 (PDT)
From: JD Smith <jdtsmith@HIDDEN>
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: compilation-get-file-structure mishandles buffers
Message-Id: <DBE4B6AE-272F-47FF-8623-C314C0E8FD32@HIDDEN>
Date: Sat, 17 Sep 2022 10:25:25 -0400
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3696.120.41.1.1)
Received-SPF: pass client-ip=2607:f8b0:4864:20::d36;
 envelope-from=jdtsmith@HIDDEN; helo=mail-io1-xd36.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


--Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


As reported =
<https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00496.html> =
on emacs-devel, a bug is present in `compilation-get-file-structure=E2=80=99=
 when the =E2=80=9Cfile=E2=80=9D matched by the =
`compilation-parse-errors=E2=80=99 is not a file, but a buffer name.  =
Both filenames and buffer names are explicitly allowed in errors.  =46rom =
the `compilation-error-regexp-alist=E2=80=99 docstring (emphasis added):

Or FILE can also be a function that returns (FILENAME) or =
(RELATIVE-FILENAME . DIRNAME). In the former case, FILENAME may be =
relative or absolute, or it may be a buffer.

Note that this is useful for modes which report errors in text from open =
buffers, which may have no associated file.   The issue is this line in =
`compilation-get-file-structure=E2=80=99:

	(if (file-name-absolute-p filename)
	    (setq filename (concat comint-file-name-prefix filename)))

which signals an=20=

--Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div =
class=3D""><br class=3D""></div><div class=3D"">As&nbsp;<a =
href=3D"https://lists.gnu.org/archive/html/emacs-devel/2022-02/msg00496.ht=
ml" class=3D"">reported</a>&nbsp;on emacs-devel, a bug is present in =
`compilation-get-file-structure=E2=80=99 when the =E2=80=9Cfile=E2=80=9D =
matched by the `compilation-parse-errors=E2=80=99 is not a file, but a =
buffer name. &nbsp;Both filenames and buffer names are explicitly =
allowed in errors. &nbsp;=46rom the `<span style=3D"caret-color: rgb(63, =
11, 119); color: rgb(63, 11, 119); font-family: ui-monospace, =
SFMono-Regular, &quot;SF Mono&quot;, Menlo, Consolas, &quot;Liberation =
Mono&quot;, monospace; white-space: pre; background-color: rgb(255, 255, =
255);" class=3D"">compilation-error-regexp-alist</span>=E2=80=99 =
docstring (emphasis added):</div><blockquote style=3D"margin: 0 0 0 =
40px; border: none; padding: 0px;" class=3D""><blockquote class=3D"" =
style=3D"margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div =
class=3D""><font color=3D"#000000" class=3D""><br class=3D"">Or FILE can =
also be a&nbsp;function that returns (FILENAME) or (RELATIVE-FILENAME . =
DIRNAME).&nbsp;In the former case, FILENAME may be relative or absolute, =
or it <b style=3D"caret-color: rgb(0, 0, 0);" class=3D"">may&nbsp;be a =
buffer</b>.</font></div><div class=3D""><br =
class=3D""></div></blockquote></blockquote><span style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0);" class=3D"">Note that this is useful =
for modes which report errors in text from open buffers, which may have =
no associated file. &nbsp;</span>&nbsp;The issue is this line =
in&nbsp;<span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" =
class=3D"">`compilation-get-file-structure=E2=80=99</span>:<div =
class=3D""><table data-hpc=3D"" class=3D"js-tagsearch-file highlight =
tab-size js-file-line-container js-code-nav-container" data-tab-size=3D"8"=
 data-paste-markdown-skip=3D"" data-tagsearch-lang=3D"Emacs Lisp" =
data-tagsearch-path=3D"lisp/progmodes/compile.el" style=3D"box-sizing: =
border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; =
caret-color: rgb(49, 59, 69); color: rgb(49, 59, 69); font-family: =
-apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, =
Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI =
Emoji&quot;; font-size: 14px;"><tbody style=3D"box-sizing: border-box;" =
class=3D""><tr style=3D"box-sizing: border-box;" class=3D""></tr><tr =
style=3D"box-sizing: border-box;" class=3D""><td id=3D"LC3208" =
class=3D"highlighted blob-code blob-code-inner js-file-line" =
style=3D"box-sizing: border-box; padding: 0px 10px; position: relative; =
line-height: 20px; vertical-align: top; overflow: visible; word-wrap: =
anywhere; box-shadow: inset 2px 0 0 var(--color-attention-muted);"><font =
face=3D"ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, =
Liberation Mono, monospace" class=3D""><span style=3D"font-size: 12px; =
white-space: pre;" class=3D""><br class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;">	=
</span>(if&nbsp;(file-name-absolute-p&nbsp;filename)<br class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;">	</span> &nbsp; =
&nbsp;(setq&nbsp;filename (concat&nbsp;comint-file-name-prefix =
filename)))<br class=3D""></span></font><br =
class=3D""></td></tr></tbody></table>which signals =
an&nbsp;</div></body></html>=

--Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65--




Acknowledgement sent to JD Smith <jdtsmith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#57883; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 18 Sep 2022 11:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.