emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Prompting for user name when running block on remote machine
@ 2014-07-04 23:17 Andreas
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas @ 2014-07-04 23:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

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 <https://plus.google.com/s/%23%2Bbegin_src> sh :dir (concat
"/ssh:" (read-string "login name: ") "@some.other.place:")
     echo $USER
#+end_src <https://plus.google.com/s/%23%2Bend_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
Andreas

[-- Attachment #2: Type: text/html, Size: 1150 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread
* Re: Prompting for user name when running block on remote machine
@ 2014-07-08 20:37 Andreas
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas @ 2014-07-08 20:37 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

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 <https://plus.google.com/s/%23%2Bbegin_src> sh :dir (concat
> "/ssh:" (read-string "login name: ") "@some.other.place:")
>      echo $USER
> #+end_src <https://plus.google.com/s/%23%2Bend_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
>

[-- Attachment #2: Type: text/html, Size: 2123 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-08 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-04 23:17 Prompting for user name when running block on remote machine Andreas
  -- strict thread matches above, loose matches on Subject: below --
2014-07-08 20:37 Andreas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).