GNU bug report logs -
#13335
24.1; compilation misparses GNU-style message locations
Previous Next
Reported by: Mattias Engdegård <mattiase <at> bredband.net>
Date: Wed, 2 Jan 2013 15:31:01 UTC
Severity: important
Merged with 7725
Found in version 24.1
Fixed in version 24.4
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13335 in the body.
You can then email your comments to 13335 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13335
; Package
emacs
.
(Wed, 02 Jan 2013 15:31:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mattias Engdegård <mattiase <at> bredband.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 02 Jan 2013 15:31:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
According to the GNU standards, a valid error message format is
FILE:LINE.COL1-COL2: MESSAGE
but this is not parsed correctly by the "gnu" regexp in compile.el;
it is interpreted as the line range LINE-COL2 starting at column COL1.
The consequence is that Emacs does not highlight the correct part of the
buffer when entering the file at that location.
This was disovered when writing a tool whose diagnostics would work
nicely with Emacs. Using the longer form
FILE:LINE.COL1-LINE.COL2: TEXT
worked correctly. According to etc/compilation.txt, it looks like the
intention is to allow either format.
The "gnu" regexp is quite complex and it is not immediately obvious
what is wrong. There is also what appears to be a superfluous backslash
on the last line:
*[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
^
Since "\[" just means "[", this does not affect the actual regexp.
In GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll
bars)
of 2012-07-30 on bach.e.vtech
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13335
; Package
emacs
.
(Thu, 10 Jan 2013 07:54:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 13335 <at> debbugs.gnu.org (full text, mbox):
Mattias Engdegård wrote:
> According to the GNU standards, a valid error message format is
>
> FILE:LINE.COL1-COL2: MESSAGE
>
> but this is not parsed correctly by the "gnu" regexp in compile.el;
> it is interpreted as the line range LINE-COL2 starting at column COL1.
Thanks. It seems there was a misunderstanding of what this format meant,
because in the Emacs test-suite it is also interpreted as LINE1.COL1-LINE2.
> The "gnu" regexp is quite complex and it is not immediately obvious
> what is wrong. There is also what appears to be a superfluous backslash
> on the last line:
>
> *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
> ^
> Since "\[" just means "[", this does not affect the actual regexp.
That does \[ look wrong, but I don't think it is related.
It seems difficult to do all the following with a single regexp and
still get the subexpressions to have the same numbers in each case:
LINE1
LINE1[.:]COL1
LINE1.COL1-COL2
LINE1.COL1-LINE2.COL2
LINE1-LINE2
LINE1-LINE2.COL2 # this seems to be something Emacs made up AFAICS
This is the best I can come up with:
*** lisp/progmodes/compile.el 2013-01-07 01:23:26 +0000
--- lisp/progmodes/compile.el 2013-01-10 07:42:50 +0000
***************
*** 134,139 ****
--- 134,140 ----
;; If you make any changes to `compilation-error-regexp-alist-alist',
;; be sure to run the ERT test in test/automated/compile-tests.el.
+ ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit
(defvar compilation-error-regexp-alist-alist
'((absoft
***************
*** 261,268 ****
;; The "in \\|from " exception was added to handle messages from Ruby.
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
! \\([0-9]+\\)\\(?:[.:]\\([0-9]+\\)\\)?\
! \\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
*\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
*[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
--- 262,269 ----
;; The "in \\|from " exception was added to handle messages from Ruby.
"^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\
\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\
! \\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\
! \\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\
\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
*\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\
*[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)"
=== modified file 'test/automated/compile-tests.el'
*** test/automated/compile-tests.el 2013-01-01 09:11:05 +0000
--- test/automated/compile-tests.el 2013-01-10 07:39:23 +0000
***************
*** 176,183 ****
("foo.c:8.23: note: message" 1 23 8 "foo.c")
("foo.c:8.23: info: message" 1 23 8 "foo.c")
("foo.c:8:23:information: message" 1 23 8 "foo.c")
! ("foo.c:8.23-45: Informational: message" 1 (23 . nil) (8 . 45) "foo.c")
("foo.c:8-23: message" 1 nil (8 . 23) "foo.c")
("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c")
("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c")
("jade:dbcommon.dsl:133:17:E: missing argument for function call"
--- 176,185 ----
("foo.c:8.23: note: message" 1 23 8 "foo.c")
("foo.c:8.23: info: message" 1 23 8 "foo.c")
("foo.c:8:23:information: message" 1 23 8 "foo.c")
! ("foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c")
("foo.c:8-23: message" 1 nil (8 . 23) "foo.c")
+ ;; The next one is not in the GNU standards AFAICS.
+ ;; Here we seem to interpret it as LINE1-LINE2.COL2.
("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c")
("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c")
("jade:dbcommon.dsl:133:17:E: missing argument for function call"
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13335
; Package
emacs
.
(Thu, 10 Jan 2013 18:53:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 13335 <at> debbugs.gnu.org (full text, mbox):
10 jan 2013 kl. 08.53 skrev Glenn Morris:
> LINE1-LINE2.COL2 # this seems to be something Emacs made up AFAICS
Is that something we need to keep, or do you consider it a "regression"
to remove it? It does not look very useful to me (a range of lines but
the same column?).
Anyway, I can confirm that your patch works for a very small variety
of tools (including the bug subject). Thanks for taking care of this.
What about transforming that regexp into rx form, by the way?
Besides being a more readable form (and fewer backslashes),
it would also permit explanatory comments to be put at their natural
places inside.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13335
; Package
emacs
.
(Thu, 10 Jan 2013 20:33:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 13335 <at> debbugs.gnu.org (full text, mbox):
Mattias Engdegård wrote:
>> LINE1-LINE2.COL2 # this seems to be something Emacs made up AFAICS
>
> Is that something we need to keep, or do you consider it a "regression"
> to remove it? It does not look very useful to me (a range of lines but
> the same column?).
It does look fairly nonsensical...
> What about transforming that regexp into rx form, by the way?
> Besides being a more readable form (and fewer backslashes),
> it would also permit explanatory comments to be put at their natural
> places inside.
More comments would be good, but could be inserted just as easily by
breaking the regexp up using concat, so personally I don't see any need
to switch to rx. (I don't always find rx more readable.)
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Mon, 14 Jan 2013 01:09:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Mattias Engdegård <mattiase <at> bredband.net>
:
bug acknowledged by developer.
(Mon, 14 Jan 2013 01:09:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 13335-done <at> debbugs.gnu.org (full text, mbox):
Version: 24.4
Fixed in trunk.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 11 Feb 2013 12:24:03 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 22 Feb 2013 01:17:02 GMT)
Full text and
rfc822 format available.
Forcibly Merged 7725 13335.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 22 Feb 2013 01:17:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 22 Mar 2013 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.