How can I tell Emacs than whenever it tries to open file
/a/b/c/foo.txt, it should instead open
I have a few projects and libraries which are accessible via multiple paths on the filesystem. This is mostly done by symlinks, but not only - sometimes I use bind mounts (some software, e.g. git, treats symlinks differently), and sometimes the files will simply always be identical copies of some other files.
Although when manually opening files, I always open them at their canonical location, following error messages and using "go-to-definition" actions will often open files under aliased paths, and I will end up with multiple buffers pointing to the same file. As such, I'd like to define a rule set of how to rewrite paths of all files it attempts to open. What would be the way to do this?