Thanks Michael!

-Wenguang

> On Apr 12, 2020, at 3:10 AM, Michael Albinus <[email protected]> wrote:
> 
> Wenguang Wang <[email protected]> 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.


Reply via email to