From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: org babel support for tcl and awk Date: Tue, 24 May 2011 17:51:01 -0600 Message-ID: <87lixvd5ei.fsf@gmail.com> References: <20110524113109.fo2dcd0mwno0c4w4@webmail.dds.nl> <8739k46z2p.fsf@gmail.com> <874o4kvvcb.fsf@ucl.ac.uk> <87vcwz9b02.fsf@gmail.com> <80boyr50w4.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP1NV-0004JT-Sq for emacs-orgmode@gnu.org; Tue, 24 May 2011 19:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QP1NU-000813-Ji for emacs-orgmode@gnu.org; Tue, 24 May 2011 19:51:09 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:41985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP1NU-00080y-DQ for emacs-orgmode@gnu.org; Tue, 24 May 2011 19:51:08 -0400 Received: by pvc12 with SMTP id 12so4297032pvc.0 for ; Tue, 24 May 2011 16:51:07 -0700 (PDT) In-Reply-To: <80boyr50w4.fsf@somewhere.org> (Sebastien Vauban's message of "Tue, 24 May 2011 21:55:39 +0200") 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > Hi Eric(s), > > Eric Schulte wrote: >> Eric S Fraga writes: >>> this is great to see as I use awk quite often. What is involved in >>> extending this to be able to run an awk script on input from within the org >>> file (output of another babel block, for instance, as my typical use of awk >>> is to re-arrange output from another program...)? Or, if you wish, can you >>> suggest one of the ob-XXX modules that best illustrates how to do this and >>> I can give it a try? >> >> I've made a quick change so that any variable named "stdin" is treated >> specially, in that, rather than using its value to replace strings of $stdin >> in the text of the awk code, the value of the stdin variable is saved into >> the file processed by awk. This allows awk to operate over Org-mode >> references. >> >> If babel code block supported a pipe or an actual stdin header argument, >> that would be the ideal way to add this behavior, but currently nothing of >> that nature exists. >> >> Please let me know if this misses part of your suggestion, or more generally >> what else may be advisable before we add this to the core. > > Could this be implemented for sh as well? > > AFAI understand, this is exactly the missing piece for me to be able to: > Hi Seb, Unfortunately this simple hack for ob-awk does not address the need you link to below -- which I am aware of and which is on my list of larger longer-term Babel development items. I think that a future piping implementation will be the ultimate solution to the issues you address. Such an implementation -- allowing data to flow between concurrently executing blocks utilizing posix pipes -- will require more sophisticated processes interaction and possibly some form of multi-threaded elisp execution. Best -- Eric > > - run consecutive partial blocks of code in my Org buffer (seeing what > they really do on input data), > > - export the full list of block as a script. > > This was described in > http://www.mail-archive.com/emacs-orgmode@gnu.org/msg36976.html, and still > impossible -- for me! -- to do right now. But I'm not very sure I wrote my > thoughts in an enough understandable way -- maybe not clear enough to me? > > Best regards, > Seb -- Eric Schulte http://cs.unm.edu/~eschulte/