From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: [babel] noweb and results for ob-screen? Date: Mon, 19 Dec 2011 20:18:49 +0900 Message-ID: <4EEF1D99.8060902@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcbFA-0000ap-6f for emacs-orgmode@gnu.org; Mon, 19 Dec 2011 06:19:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RcbF8-0003Hp-J6 for emacs-orgmode@gnu.org; Mon, 19 Dec 2011 06:18:56 -0500 Received: from mail-gx0-f169.google.com ([209.85.161.169]:46525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RcbF8-0003Hh-CJ for emacs-orgmode@gnu.org; Mon, 19 Dec 2011 06:18:54 -0500 Received: by ggni2 with SMTP id i2so4730546ggn.0 for ; Mon, 19 Dec 2011 03:18:53 -0800 (PST) In-Reply-To: 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: Org Mode Mailing List Hmmm... I looked a bit into it and it seems screen can log the session into a file. org-mode could read the total number of lines of that file before executing a new block of the same session and add the number of line feeds for the executed source code block. Hence, we would know at which point the "result" would start. However, this would add the entire output of the source code block as result. One could limit the result to the last send command by the above method too. Just splitting the source code block internally into two parts. The first one contains all but the last command, the second contains only the last command. As for noweb, I can't see from the source code why it should not work. Does someone have an idea about that. I gave names to all my source code blocks. Then I defined a source code block with the header argument :noweb true. However all <> lines are send to screen instead of the content of so called source code blocks. I also looked into variables. However, this seems to be a bit tricky, the problem is screen runs interactively, hence, you could run all kind of other stuff in the screen session, e.g., python, emacs, a serial terminal, etc. . How could org-mode know if it has to warp the variable according to python-, shell-, lisp- or any other syntax. Might it be possible (and does it make sense) to simply enable some kind of macro-like replacement. E.g. :var _X_=3 would replace all _X_ by 3. There would be no formal syntax and no format rules. Just a simple greedy search and replace. Thus, the user can/have to think by himself how a variable name would have to look like to get no conflict with the target language. E.g. :var var=12 could be a bad idea if the source code would be test = var var2 = 12 def variant(): because it would be replaced by test = 12 122 = 12 def 12iant(): We could not rely on spaces around variables because some languages might not allow spaces. That is test=12 can not be written test = 12 However, source code blocks are normally relatively small and the user could use any kind of scheme which makes a distinction with the target language within screen easy (using all kind of seldom used characters _,%,#, etc.) Any thoughts or ideas? I really like the interactive screen functionality which allows me to perform all kind of tasks interactively within a screen session. Torsten On 12/17/2011 06:38 PM, Torsten Wagner wrote: > Hi, > recently I discovered babel in combination with screen. I really like it. > However, I tried to use noweb but it seems not to work. Getting it working > would allow to write "tasks" and arbitrary combine them to bigger tasks. > > I would be interested in results too. Would be nice to receive some > feedback from above tasks. Thus, one could document the success or > results. For now I have to copy results from the screen terminal which is > kind of error prone. > > Any chance to enhance ob-screen with the above features? > > Totti >