[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to run compile command on remote machine with a different direct
From: |
Wenguang Wang |
Subject: |
Re: How to run compile command on remote machine with a different directory |
Date: |
Sun, 12 Apr 2020 09:16:51 -0700 |
Thanks Michael!
-Wenguang
> On Apr 12, 2020, at 3:10 AM, Michael Albinus <address@hidden> wrote:
>
> Wenguang Wang <address@hidden> writes:
>
> Hi,
>
>> I want to run compile command from any buffer. So now my workaround is
>> to change my build.sh to pipe the output to sed and prepend the
>> project path name on the relative path name to make it an absolute
>> path name. Since all my source code are under a single directory
>> “src”, I was able to do this by something like:
>>
>> my-compile-command | sed 's|^src|'$prjdir'/src|g'
>
> A solution just with Lisp would be (untested)
>
> --8<---------------cut here---------------start------------->8---
> (defun my-compile-command ()
> (interactive)
> (let ((default-directory "/ssh:user@host:/abs/path/to/project_root"))
> (compile "./build.sh")))
> --8<---------------cut here---------------end--------------->8---
>
> Then you can call "M-x my-compile-command".
>
>> -Wenguang
>
> Best regards, Michael.