From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Subject: Re: Prompting for user name when running block on remote machine Date: Tue, 8 Jul 2014 22:37:54 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e011617bef0ea7204fdb490d1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4c9K-0005AD-LI for emacs-orgmode@gnu.org; Tue, 08 Jul 2014 16:38:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4c9D-0002SJ-Ot for emacs-orgmode@gnu.org; Tue, 08 Jul 2014 16:38:02 -0400 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:46491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4c9D-0002S5-Jw for emacs-orgmode@gnu.org; Tue, 08 Jul 2014 16:37:55 -0400 Received: by mail-ie0-f173.google.com with SMTP id x19so2692829ier.4 for ; Tue, 08 Jul 2014 13:37:54 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --089e011617bef0ea7204fdb490d1 Content-Type: text/plain; charset=UTF-8 Hello again list, Just for completeness I want to post my solution to the below issue. It turned out the behaviour was caused by the variable org-src-tab-acts-natively. When set this seems to activate reading the header arguments when tabbing in the src block. My solution now is to move the evaluation to a call statement: #+name: do-stuff #+begin_src sh echo $USER #+end_src #+CALL: do-stuff[:dir (concat "/ssh:" (read-string "login name: ") "@some.other.place:/scratch")] Regards Andreas > Hi, > > I was running in to an issue when trying to run a piece of code on a > remote machine. > I run the following: > #+begin_src sh :dir (concat > "/ssh:" (read-string "login name: ") "@some.other.place:") > echo $USER > #+end_src > > the idea here was that the code block would prompt the user for the login > name and proceed to evalue the code on the remote machine. This works as I > want it. > However now when I try to edit the code in the block and press TAB for > indentation the block prompts me again for a "user name:" twice. > > I'm not sure how to go further from here or why this last thing happens. > I'm guessing that the header string is read when the code block tries to > determine what code is in there but is there a way to get the behaviour I > want without this side effect? > > Regards > --089e011617bef0ea7204fdb490d1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello again list,

Just for complete= ness I want to post my solution to the below issue. It turned out the behav= iour was caused by the variable org-src-tab-acts-natively. When set this se= ems to activate reading the header arguments when tabbing in the src block.=

My solution now is to move the evaluation to a call statemen= t:
=C2=A0=C2=A0=C2=A0 #+name: do-stuff
=C2=A0=C2=A0=C2=A0 #+begin_src= sh
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 echo $USER
=
=C2=A0=C2=A0=C2=A0 #+end_src

=C2=A0=C2=A0=C2=A0 #+CALL: d= o-stuff[:dir (concat "/ssh:" (read-string "login name: "= ;) "@some.other.place:/scratch")]

Regards
Andreas
Hi,

I w= as running in to an issue when trying to run a piece of code on a remote ma= chine.
I run the following:
#+begin_src sh :dir (conca= t "/ssh:" (read-string "login name: ") "@some.othe= r.place:")
=C2=A0=C2=A0=C2=A0=C2=A0 echo $USER
#+end_src

the idea here was that the code block would prompt the user for the login=20 name and proceed to evalue the code on the remote machine. This works as I want it.
However now when I try to edit the code in the block and press TAB for indentation the block prompts me again for a "user name:" tw= ice.

I'm not sure how to go further from here or why this last thing happens.=20 I'm guessing that the header string is read when the code block tries t= o determine what code is in there but is there a way to get the behaviour I want without this side effect?

Regards
--089e011617bef0ea7204fdb490d1--