From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Lopez Newsgroups: gmane.emacs.bugs Subject: bug#34479: Incorrect classification of messages in compilation-mode buffer Date: Thu, 14 Feb 2019 16:00:08 +0000 Message-ID: <483a94fa-e01c-f81e-ca33-44acc4ba33dd@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3C42D8B903B4B035A2FC3AA1" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="21244"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: 34479@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 14 17:03:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guJTw-00055y-C8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 17:03:24 +0100 Original-Received: from localhost ([127.0.0.1]:50800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guJTv-0007MU-4c for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Feb 2019 11:03:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guJTj-0007LK-6G for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:03:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guJTd-0008Ry-9b for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:03:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guJTa-0008PG-6U for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1guJTZ-0004Tr-QO for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Lopez Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Feb 2019 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34479 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.155016018017213 (code B ref -1); Thu, 14 Feb 2019 16:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2019 16:03:00 +0000 Original-Received: from localhost ([127.0.0.1]:48337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guJTX-0004TS-6m for submit@debbugs.gnu.org; Thu, 14 Feb 2019 11:03:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guJTV-0004TE-Rj for submit@debbugs.gnu.org; Thu, 14 Feb 2019 11:02:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guJTK-0008C9-H2 for submit@debbugs.gnu.org; Thu, 14 Feb 2019 11:02:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guJTJ-00079h-Hv for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:02:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guJT3-000843-Gj for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:02:37 -0500 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:50546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guJSx-0007mL-Vw for bug-gnu-emacs@gnu.org; Thu, 14 Feb 2019 11:02:26 -0500 Original-Received: by mail-wm1-x330.google.com with SMTP id x7so6822337wmj.0 for ; Thu, 14 Feb 2019 08:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=PcO9Hu/aXT9TQ0FMYEa0U3raJyntaCm4ioW4o+DOvFU=; b=Xh2FgPKCQ9gd45VM7waMOGta/GWdbASaFjA3yn5o6BmcYyQyFM6n2M5r5CwqgVpTKc vIz+w9MNwPnl1PsKYxLh7rSZNnfwAjxtnBHNLvW+My85P2LRObK+WOwgMmRPm2XjHtnx FvGvgEgs6n1lNfeTPeSGTDduauEkcyCBb72bNuo/V8ayML/OiQEjWxSLGtY6RKbHDnjV uSI7sFyuq0mH+HpuLaqpgx81vopZAoJTGDzLAeq+RnjhDmsbUlPF08vpN0f/QS1sb0qb v01Y4Udn4rVwH+3yth10Qqxe3N42213wmbuafre5lYWsMBFhAVWDcoS3A0U+RgHcKxWH iJyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=PcO9Hu/aXT9TQ0FMYEa0U3raJyntaCm4ioW4o+DOvFU=; b=aDJ7pgG70YVrnOXvD/nVYJkI2vLDXCWytFms/UV4xOFTXbPv5LJurHtCQLil6aqmiE zavnMYdtXQmQtm+1Q4SHC563/6rS1hk5YMUJW99qD3VzZhXKg93EkB1vZT1ZPkb211Ao fx4f9kQE7M2u6F53ASTscjd2YP5A4U6i4ec8wyCK9B4TPf2/LunkkC+8OUW55lLYg49D f7BP9Ur17yGEsq+8PKSUyRKT20KEwSiaUBH7yStbTKRbZcYHk6WhT/wh3ceaO6E+ajj9 yWsIkkfIbqxZV8eTo0gvtrs+OJKeWzXCl2JLPnCQBgH7XFzf0/m7LzmfQLSJLiawzPOf ru/A== X-Gm-Message-State: AHQUAuYMz1zx5PxrTUbORka5ptQaBgVLBTZn3GUO6Sjff8lNO9dUCHiN 65q4rypMzoUC3uQ/BnUc8itJKNoQ X-Google-Smtp-Source: AHgI3IYozZyAcYT2j7VfMSaKyJm+rHyDGDKdRjH2IwMOWiIMWQTRhMEAx973RUmoVJMrNn916IaYIw== X-Received: by 2002:a1c:80c4:: with SMTP id b187mr3052402wmd.23.1550160113080; Thu, 14 Feb 2019 08:01:53 -0800 (PST) Original-Received: from [192.168.2.2] (w-79.cust-5765.ip.static.uno.uk.net. [95.172.231.79]) by smtp.googlemail.com with ESMTPSA id e75sm166880wmg.32.2019.02.14.08.01.51 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 08:01:52 -0800 (PST) Content-Language: en-US-large X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155420 Archived-At: This is a multi-part message in MIME format. --------------3C42D8B903B4B035A2FC3AA1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Reproduce: - Open the attached test program compilation_test.c in Emacs - M-x compile - Enter compile command "gcc -c compilation_test.c" In the resulting *compilation* buffer, there should be a mixture of "error", "warning" and "note" messages. Trouble is they're all parsed as errors - hence they're all coloured in red, and querying any one's type by moving point onto it and evaluating "(compilation--message->type (get-text-property (point) 'compilation-message))" always returns 2, though warnings should return 1 and notes should return 0. Commands that jump between previous/next error also behave correspondingly wrongly. Fix: The attached fix_compilation_message_type.patch, applied to Git master, fixes it for me. It seems like the old code was accidentally using the same variable for the TYPE field of the current rule from compilation-error-regexp-alist, and in an inner loop, the actual type that the current message from the compilation buffer was resolved to be, so the resolved type of the first message tends to get carried down into the following ones. Daniel --------------3C42D8B903B4B035A2FC3AA1 Content-Type: text/x-csrc; name="compilation_test.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="compilation_test.c" int main(int argc, char ** argv) { int v = something; int w = something_else; int x = 4/0; #define MM w[10] int y = MM; return "abc"; } --------------3C42D8B903B4B035A2FC3AA1--