bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58007: 28.1; compilation-error-properties skips non-matching FILE in


From: Axel Forsman
Subject: bug#58007: 28.1; compilation-error-properties skips non-matching FILE indices
Date: Thu, 22 Sep 2022 17:09:55 +0200

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

Attachment: 0001-compile-Do-not-skip-all-non-matching-FILE-indices.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]