Wenguang Wang <[email protected]> writes:

Hi,

> My project has multiple directories and I want to invoke the build
> command from any directory. My build system prints file path relative
> to the project root directory. Therefore, when I build it on the
> remote machine using emacs on the remote machine, I have to do this:
>
> cd /abs/path/to/project_root ; ./build.sh
>
> This makes emacs know that the file names in the compile errors starts
> from which directory and I can use the “next-error” command to load
> the file and jump to the right line.
>
> However, when I run the compile command from tramp, this command fails
> with: “No such directory found via CDPATH environment variable”.
>
> Although I can start the command with: /bin/bash -c "cd
> /abs/path/to/project_root ; ./build.sh”, it does not help because
> emacs does not know the relative file path in the compile error has
> changed to a different directory.
>
> Is there a way to make this work under tramp?

You should work on a buffer which has the default-directory
"/ssh:user@host:/abs/path/to/project_root". There you can call "M-x compile",
and replace in the minibuffer the default command "make -k" by "./build.sh".

That's how I work all the time.

> Thanks!
> -Wenguang

Best regards, Michael.

Reply via email to