I run several applications, in several languages, that store their error stacks
locally. I made a small emacs mode that allows me to browse those errors and
navigate the related code. The code I wrote, at its core, is basically loading
those stacks from the database in a buffer and setting that buffer in
compilation code. Then I can browse code by using
next-error, etc. to navigate the code.
compilation-mode is great because it
knows many error regexps so I don't need to deal with them (I add to add just 3
new regexps to local variable
Very convenient and that has been working fine for years. The paths of the stacks are absolute, which suits fine to compilation mode.
But more and more I run those applications in lightweight containers. Then, the path of those stacks does not works because I have mounted the container filesystem in different paths in my host (I run emacs exclusivelly in the host, and I store the stacks there). Then, emacs cannot find the path the files are and I cannot browse them.
I mount the root filesystem os my containers in known locations. So, for a stack /a/b/c/d.c:80 in container "foo", I can calculate the path very easily: /containers/foo/a/b/c/d.c:80
I tried to use
compilation-search-path, with no avail (
does not concatenate an absolute path to the elements of the search path, only
I would appreciate some hint of how to achieve what I want (basically smarting
compilation-find-file to prepend a path to those paths in its "error lines")
that does not violates compile.el encapsulation.