On Jun 21, 2023, at 4:24 AM, Eli Zaretskii <eliz@gnu.org> wrote:

From: Dave Abrahams <dave@boostpro.com>
Date: Tue, 20 Jun 2023 15:30:58 -0700

[I hope this is the right venue for feature requests.  If not, sorry!]

This is the right place.

When a file can't be found via the path given in a diagnostic, I'd like to be able to override the prompt that emacs gives to locate the file.  compilation-parse-errors-filename-function happens too early, while the buffer is being initially parsed.  A similar compilation-locate-file-function would be great.  If there's interest I could try to develop a patch.

Before discussing patches, could you please describe your situation?
Specifically, how does it happen that neither the compilation
directory plus the file name shown by the diagnostics nor the search
of compilation-search-path succeed to locate the file?  And what would
the hook function you suggest adding do to resolve this, i.e. how
would it know where to look for the file?

When Swift asserts, it doesn't write the path to the file into the output, becauseā€¦ reasons I grudgingly accept.  So one needs to guess at the file.  https://github.com/apple/swift/issues/66777 contains all the details, but if you want additional info, please ask.