From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Possible Calc support for Org-Babel? Date: Wed, 03 Nov 2010 14:10:42 -0600 Message-ID: <87sjzigocd.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> <87k4l07njv.fsf@gmail.com> <87hbg4pooh.fsf@ucl.ac.uk> <871v7879x5.fsf@gmail.com> <87zktv7659.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=40651 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDjfb-0006cp-C5 for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:10:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDjfZ-0007PO-Pl for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:10:54 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:52937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDjfZ-0007PJ-M8 for emacs-orgmode@gnu.org; Wed, 03 Nov 2010 16:10:53 -0400 Received: by ywl5 with SMTP id 5so925456ywl.0 for ; Wed, 03 Nov 2010 13:10:53 -0700 (PDT) In-Reply-To: <87zktv7659.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Sat, 30 Oct 2010 21:54:58 +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: >> alright, thanks for sticking with this. You are definitely now using >> the latest code. I believe the newest version of the ob-calc-eval >> function should work -- at the very least it should give a nicer error >> message. Could you please require update again and let me know how it >> goes? > > (for the list's benefit: Eric and I have had a few out-of-the-list > exchanges but as everything now seems to be working fine, I thought I'd > reconnect the thread to the list...) > > Eric, > > just to confirm that it all seems to work just fine from a cold boot of > emacs without any extra (require 'ob-eval). My babel configuration has > the following: > > #+begin_src emacs_lisp > (org-babel-do-load-languages > 'org-babel-load-languages > '((R . t) > (calc . t) > (ditaa . t) > ... > #+end_src > > and that's about it really. Evaluating the calc examples you sent > initially all work perfectly. > Fantastic. > > Using src_calc{5-2}, for instance, also works just fine for export. > > I now wonder if it would be worthwhile discussing the choices you have > made regarding stack versus algebraic evaluation. I would rather have > the quote mean an algebraic expression, just from the simple reason that > these will be longer than stack operations and so the overhead of a > quote is smaller as a percentage of keystrokes... > Hmm, one point against prefixing the algebraic expressions is that they would be more likely to be used by themselves in an inline code block. Maybe there is a better way to recognize when a line is a stack vs. an algebraic expression. For example if the line is resolvable to a stack operation (i.e. an element of '(+ - ...)) then treat it as such, otherwise just treat it as an algebraic expression. > > Anyway, thanks for this. I think this is going to be quite useful but > it does mean really getting down and learning emacs calc... Yes, I need to learn calc as well.