From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.bugs Subject: bug#57883: compilation-get-file-structure mishandles buffers Date: Sat, 17 Sep 2022 10:25:25 -0400 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8413"; mail-complaints-to="usenet@ciao.gmane.io" To: 57883@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 17 16:26:13 2022 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 1oZYlo-0001y9-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 16:26:12 +0200 Original-Received: from localhost ([::1]:48330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZYlm-0000oR-Lo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Sep 2022 10:26:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZYle-0000oJ-Fk for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:26:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZYle-0001ZL-8T for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZYld-0000jv-UQ for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: JD Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Sep 2022 14:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57883 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16634247372810 (code B ref -1); Sat, 17 Sep 2022 14:26:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Sep 2022 14:25:37 +0000 Original-Received: from localhost ([127.0.0.1]:46920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYlE-0000jG-O1 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 10:25:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZYl9-0000j5-Nk for submit@debbugs.gnu.org; Sat, 17 Sep 2022 10:25:34 -0400 Original-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 ) id 1oZYl9-0000hX-IZ for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:25:31 -0400 Original-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 ) id 1oZYl7-0001Xe-Ua for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 10:25:31 -0400 Original-Received: by mail-io1-xd36.google.com with SMTP id d8so16597158iof.11 for ; 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) Original-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 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Sep 2022 07:25:27 -0700 (PDT) X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::d36; envelope-from=jdtsmith@gmail.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:242875 Archived-At: --Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 As reported = = 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

As reported 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 
= --Apple-Mail=_5756DD66-30C1-44E1-B33F-064C26D5EA65--