From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Subject: Re: [babel] adding a language - problems Date: Thu, 29 Sep 2011 20:27:42 +0200 Message-ID: <86d3ejcig1.fsf@googlemail.com> References: <86oby471k3.fsf@googlemail.com> <86k48s6ztv.fsf@googlemail.com> <871uuzbj8h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9LKx-0007T0-JP for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 14:28:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9LKw-0000cY-Cn for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 14:27:59 -0400 Received: from lo.gmane.org ([80.91.229.12]:40505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9LKv-0000b5-Uo for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 14:27:58 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R9LKt-0006cJ-Jz for emacs-orgmode@gnu.org; Thu, 29 Sep 2011 20:27:55 +0200 Received: from e178060012.adsl.alicedsl.de ([85.178.60.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Sep 2011 20:27:55 +0200 Received: from quintfall by e178060012.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Sep 2011 20:27:55 +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: emacs-orgmode@gnu.org Eric Schulte writes: > Thorsten writes: > >> Thorsten writes: >> >>> Hi list, >>> I'm on my way to add a new (intrpreted) lisp dialect to org-babel, but >>> encounter a few difficulties. Here is my little testprogramm: >>> >>> --------------------- >>> #+tblname: tbl1 >>> | 1 | 2 | 3 | >>> |---+---+---| >>> | 4 | 5 | 6 | >>> | 7 | 8 | 9 | >>> >>> >>> # external evaluation (no session) >>> #+srcname: pico-calc >>> #+begin_src picolisp :var tab=tbl1 :results value :hlines no >>> (+ (caar tab) (caar (cdr tab))) >>> #+end_src >>> >>> # org-babel-error output: >>> [/tmp/babel-22634XBd/picolisp-script-22634K-K:1] !? (display (prog (let >>> (tab '((1 2 3) (4 5 6) (7 8 9))) (+ (caar tab) (caar (cdr tab)))))) >>> display -- Undefined >>> >>> >>> # with session >>> #+srcname: pico-calc >>> #+begin_src picolisp :var tab=tbl1 :results value :hlines no :session "p1" >>> (+ (caar tab) (caar (cdr tab))) >>> #+end_src >>> >>> #+results: pico-calc >>> [finishes with no output] >>> >>> # session buffer: >>> (prog (let (tab '((1 2 3) (4 5 6) (7 8 9))) >>> (+ (caar tab) (caar (cdr tab)))) ) >>> "org-babel-picolisp-eoe" >>> -> 5 >>> : -> "org-babel-picolisp-eoe" >>> >>> --------------- >>> >>> I do not know where undefined 'display' comes from in the error message >>> - seems to be a org-babel internal thing. What can I do about that, >>> where do I have to look? >>> >>> The session evaluation works already, but there is a problem with the >>> eoe string. If I don't use it, Emacs hangs forever - waiting for the >>> session to return? If I use it, the right value is calculated, but not >>> returned - because the eoe string is evaluated after the source-body? >>> > > I assume you're using `org-babel-comint-with-output' to collect results? > If you're still having issues I'd suggest looking at some of the other > uses of this function in other ob-*.el files for example of ways that > it's use can be customized through code in the BODY section. yes, I use org-babel-comint-with-output more or less in the way it is used in ob-scheme.el. > >>> >>> Thanks for any tips Thorsten >> >> >> Sorry, I encountered the undefined 'display' in source code I copied >> from ob-scheme, I deleted it, and then external evaluation succeeded - >> but again without output. > > Hopefully ":results output" is already working and it is just ":results > value" which requires more work. No, it isn't working - same thing as with :results value - no error messages, but nothing is returned either and no output. I have to take a deeper look at whats happening behind the scenes. > "results value" external evaluation > generally works by wrapping the body of the code block in a form which > will collect the result of the code block and print them to STDOUT. > Writing this wrapped body to a temporary file, evaluating this temporary > file, and then collecting the results from STDOUT. I'd suggest > confirming that each of the above steps are working independently. > >> >> So I seem to be quite close, evaluation work and the right value is >> calculated - but not returned yet. >> > > I hope the above helps. Let me know if you run into any more issues. > > Cheers -- Eric Thanks so far, I'll try to understand the workings of ob.el & friends better and then hope to get things to work. cheers Thorsten