Subject: bug#7725: compilation-mode misinterprets column range on a single line

From: Ben Pfaff <[email-masked]>
Date: Thu, 23 Dec 2010 21:59:16 -0800

The GNU coding standards, at
http://www.gnu.org/prep/standards/html_node/Errors.html#Errors
say that one possible form for an error message is to mention a
line number and a range of columns, like this:

        file:line.c1-c2: message

However, Emacs compilation-mode misinterprets this form: it
treats c2 as a second line number.

For example, suppose I put the following in a.txt:

----------------------------------------------------------------------
One line of text.
Second line of text.
Third line of text.
----------------------------------------------------------------------

and then the following in b.txt:

----------------------------------------------------------------------
-*- compilation -*-

a.txt:1.2-3: error: This error message will be misinterpreted as lines 1-3.
a.txt:1.2-1.3: error: This error message will be interpreted correctly.
----------------------------------------------------------------------

If I click on the first error message in b.txt, then Emacs will
briefly highlight all of a.txt except for the first character of
the first line.  If I click on the second error message, then I
get the expected behavior for the first message, that is, the
second and third characters of the first line in a.txt are
highlighted.

M-x emacs-version reports: GNU Emacs 23.2.1 (i486-pc-linux-gnu,
GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian

I haven't made any local changes, and I see the same behavior
with "emacs -q" to turn off my .emacs file.

Thanks,

Ben.
-- 
Ben Pfaff 
http://benpfaff.org