GNU bug report logs -
#58007
28.1; compilation-error-properties skips non-matching FILE indices
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Greetings:
The documentation for compilation-error-regexp-alist states
> If FILE, LINE or COLUMN are nil or that index didn’t match, that
> information is not present on the matched line. In that case the
> file name is assumed to be the same as the previous one in the
> buffer, line number defaults to 1 and column defaults to
> beginning of line’s indentation.
which clearly, unambiguously implies that if the FILE index does not match
then the previous file name should be used for the error.
However that is not what the code does currently,
instead it skips such matches.
I believe the documented behavior would be strictly more useful
than the current implemented behavior,
since if unwanted then the file subexpression in the regex should be
non-optional anyway.
My use case would be to more easily match errors stretching multiple lines,
where the file name is only mentioned in a header.
I have attached a patch containing my suggested fix.
On a side note, the code for handling the case when FILE is a function
that returns a (RELATIVE-FILENAME . DIRNAME) cons-cell looks a bit funky.
It could probably be cleaned up.
Kind regard
Axel Forsman
[0001-compile-Do-not-skip-all-non-matching-FILE-indices.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.