all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Lopez <daniel.lopez999@gmail.com>
To: 34479@debbugs.gnu.org
Subject: bug#34479: Incorrect classification of messages in compilation-mode buffer
Date: Thu, 14 Feb 2019 16:00:08 +0000	[thread overview]
Message-ID: <483a94fa-e01c-f81e-ca33-44acc4ba33dd@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

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

[-- Attachment #2: compilation_test.c --]
[-- Type: text/x-csrc, Size: 165 bytes --]


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";
}

             reply	other threads:[~2019-02-14 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 16:00 Daniel Lopez [this message]
2019-02-14 16:05 ` bug#34479: Incorrect classification of messages in compilation-mode buffer Daniel Lopez
2019-02-15  8:02   ` Eli Zaretskii
2019-02-25 13:26     ` Tobias Bading
2019-02-25 16:03       ` Daniel Lopez
2019-03-01 10:07       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=483a94fa-e01c-f81e-ca33-44acc4ba33dd@gmail.com \
    --to=daniel.lopez999@gmail.com \
    --cc=34479@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.