[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: |
Michael Albinus |
Subject: |
Re: How to run compile command on remote machine with a different directory |
Date: |
Sun, 12 Apr 2020 12:10:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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.