[emacs-berlin] Literate dev-ops

Michael Albinus michael.albinus at gmx.de
Wed May 11 14:41:36 UTC 2016

Arne Brasseur <arne.brasseur at gmail.com> writes:

> One thing that I miss though is using relative locations, especially
> in combination with tramp, e.g. if I have
>   :dir: /ssh:root at server1:/var/web
>   :results: scalar
>   :END:
> Then I'd like to say, now on that server do sudo
>   #+BEGIN_SRC shell :dir /sudo:www-data at server1:
> But instead I need to repeat the whole thing (which makes sense, I
> guess the most specific `:dir` takes preference)
>   #+BEGIN_SRC shell :dir /ssh:root at server1|sudo:www-data at server1:

Write somewhere in your .emacs:

(add-to-list 'tramp-default-proxies-alist
             '("\\`server1\\'" "\\`www-data\\'" "/ssh:root@%h:"))

Then you can always use "/sudo:www-data at server1:", and it will go there
via "/ssh:root at server1:".

Best regards, Michael.

More information about the emacs-berlin mailing list