From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: [babel] noweb and results for ob-screen? Date: Fri, 23 Dec 2011 14:16:19 +0000 Message-ID: References: <87fwgc4pai.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Re5v4-0003e3-FK for emacs-orgmode@gnu.org; Fri, 23 Dec 2011 09:16:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Re5v2-00073G-Sh for emacs-orgmode@gnu.org; Fri, 23 Dec 2011 09:16:22 -0500 Received: from mail-vx0-f169.google.com ([209.85.220.169]:48518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Re5v2-000738-QI for emacs-orgmode@gnu.org; Fri, 23 Dec 2011 09:16:20 -0500 Received: by vcge1 with SMTP id e1so7743575vcg.0 for ; Fri, 23 Dec 2011 06:16:19 -0800 (PST) In-Reply-To: <87fwgc4pai.fsf@ucl.ac.uk> 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: Torsten Wagner , Org Mode Mailing List Hi Eric, thanks for pushing this up :) Well as far as I understood, ob-sh is at the final end (after org-babel did its job) a shell script which will be executed. ob-screen is an interactive connection to a screen session. Everything inside the source cgode block will be sent to this session. This is not limited to terminal commands, but could e.g., be keystrokes for a ncurse based program, a serial terminal, etc. Furthermore all is send over "as-it-is" Thus you could have different code blocks and concatenate them to complex commands. E.g., (not complex but for demo ;) ) #+src_name copy #+begin_src screen :session copy cp -ar #+end_src #+src_name source1 #+begin_src screen :session copy ~/data #+end_src #+src_name source2 #+begin_src screen :session copy ~/picture #+end_src #+src_name target1 #+begin_src screen :session copy /media/sdb1 #+end_src #+src_name target2 #+begin_src screen :session copy /media/sdb2 #+end_src Now you could call the code-blocks in the desired combination to create e.g. cp -ar ~/data /media/sdb1 or cp -ar ~/picture /media/sdb2 etc. Please note that the target blocks contain an empty line to send over a carriage return and hence start the final command in the screen session. Guess you could easily think of far more complex examples. The screen session is running parallel in an window beside emacs (guess it might be even possible to run it within emacs by e.g. eshell). Thus it is perfect to augmented the tasks. Unfortunately, ob-screen seems to have no idea of variables and results. Furthermore, I did not get noweb working but did not see why it should not work. At the moment I try to use it to open a serial terminal and talk to an measurement device. I can easily send over the commands necessary to talk to the device, but having noweb would allow me to combine different commands into small scripts. Like <> <> <> <> Each of those might contain many lines of cryptic ASCII characters and numbers You can try #+src_name start_emacs #+begin_src screen :session emacs emacs -nw #+end_src #+src_name hello_emacs_world #+begin_src screen :session emacs Hello Emacs World !!!! #+end_src Hope you get the idea :D Now imagine if you could send in variables, get results and being able to put different code blocks together. Torsten