From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Possible Calc support for Org-Babel? Date: Fri, 29 Oct 2010 14:26:44 -0600 Message-ID: <87k4l07njv.fsf@gmail.com> References: <7CDB7386-9B39-46CB-94E8-C6B5CBD59C4F@me.com> <87mxq0ajgw.fsf@gmail.com> <87zktxv6s2.fsf@gmail.com> <87y69h8d4t.fsf@ucl.ac.uk> <87y69ht5f5.fsf@gmail.com> <87tyk4epxl.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=46909 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBvkD-0001Mo-An for emacs-orgmode@gnu.org; Fri, 29 Oct 2010 16:40:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBvXG-0006rC-EU for emacs-orgmode@gnu.org; Fri, 29 Oct 2010 16:26:51 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:37196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBvXG-0006r2-Bk for emacs-orgmode@gnu.org; Fri, 29 Oct 2010 16:26:50 -0400 Received: by gyh20 with SMTP id 20so2692052gyh.0 for ; Fri, 29 Oct 2010 13:26:49 -0700 (PDT) In-Reply-To: <87tyk4epxl.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Fri, 29 Oct 2010 20:53:26 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric S Fraga Cc: emacs-orgmode@gnu.org, Matthew Oesting Eric S Fraga writes: > "Eric Schulte" writes: > >> Eric S Fraga writes: >> >>> Eric, >>> >>> This is really nice! >>> >>> I had a problem initially in that calc-push-list was undefined. I had >>> to initiate calc first so maybe a >>> >>> : (require 'calc) >>> >> >> Ah yes, that is in the ob-calc.el file, but not in the code snippet I >> shared. I'll commit this entire file to the repository. > > Ah, so should I use the code snippet you sent or should I be requiring > 'ob-calc? In either case, I still have problems (see below). > Require ob-calc, please don't use the snippet below. > >>> is required to ensure the functions you use are available? >>> >>> Then, out of the three examples you give, only one (3^3) worked. The >>> others give me: >>> >> >> I just made a change which should fix this issue. > > Very strange. I'm still seeing the same problems, both with > calc-push-list not known (having to manually require 'calc) and then > errors evaluating the 1+2 block: > judging from the error below, it looks as though you are still using the old code (or the snippet below). Please ensure you're on the latest and give it another go. > > Debugger entered--Lisp error: (wrong-type-argument stringp (2 >"Expected a number")) > string-match("\\` *\\([0-9]+\\) *\\'" (2 "Expected a number")) > math-read-number((2 "Expected a number")) > (list (math-read-number (calc-eval line))) in the latest code the line (list (math-read-number (calc-eval line))) has been replaced by (list ((lambda (res) (if (numberp res) res (math-read-number res))) (calc-eval line))) Best -- Eric