I am using emacs 27.2 under cygwin and compilation-mode to build software and jumping to any compilation errors with 'next-error. The build system is GnuWin32 make. Therefore, I have to live with mixed path types. GnuWin32 make
will produce windows-style path, whilst emacs expect posix-like paths.
When running GnuWin32 make, it will print messages about changing directory like:
Entering directory 'C:/Users/path-to-dir'
which emacs parses and uses to jump to the line that caused the compilation error.
When I have compilation errors and I do 'next-error to jump to the source file, in the minibuffer I get
Find this error in (default relative-path-to-file-with-error): /cygdrive/c/path-to-make-entry-directory/C:/Users/path-to-build
Emacs is concatenating the directory parsed from the make "Entering directory" message with the make entry directory, which obviously doesn't exist. It seems the problem is to do with the mixed types.
I read there is windows_path.el to perform the translation, but that doesn't seem to work and I get these errors:
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
error in process filter: compilation--put-prop: Args out of range: 0, 2
error in process filter: Args out of range: 0, 2
Compilation exited abnormally with code 2
Alternatively, cygpath --unit can be used to do the translation. I am not sure how to hook it though.