From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gilles Charron Subject: Interaction between org tables and embedded calc Date: Tue, 21 Aug 2012 13:21:41 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3olb-0005py-T0 for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 09:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3ola-0008CW-JW for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 09:45:11 -0400 Received: from plane.gmane.org ([80.91.229.3]:43457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3ola-0008AJ-DC for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 09:45:10 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T3oWx-0003LK-Tm for emacs-orgmode@gnu.org; Tue, 21 Aug 2012 15:30:04 +0200 Received: from 173-195-59.82.tel-ott.com ([173-195-59.82.tel-ott.com]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Aug 2012 15:30:03 +0200 Received: from gilles.charron by 173-195-59.82.tel-ott.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Aug 2012 15:30:03 +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 Hi, I recently discovered the beauty of emacs embedded calc. Works great inside org files for note taking with math & engineering related content. I've been trying to get org tables and embedded calc to coordinate with each other using assigned variables however it appears that embedded calc uses some sort of namespace for storing variables. Below is a sample of what I'm trying to do: Let's say I need to calculate something - I'll assign it to an embedded calc variable: myVariable := 1 + 0.5 => 1.5 Now, embedded calc knows about "myVariable" . Next I would like to use this variable inside a org table (like offset all elements in a column with "myVariable"): | Data | Corrected Data (-myVariable) | | 0 | should yield -1.5 | | 1 | should yield -0.5 | | 2 | should yield 0.5 | I've been trying to use calc-eval along with evalv however they don't appear to resolve "myVariable". Reading though the embedded calc documentation: "The assignment operator `a := 17' does not actually do anything by itself. But Embedded Mode recognizes it and marks it as a sort of file-local definition of the variable." How can I access these "file-local definitions" through "calc-eval" or org tables? Essentially, I'm looking for an equivalent of org properties "$PROP_propertyName" which can be accessed in org tables. I would also like the ability to read from an org table and use the content later in a embedded math equation: | Data | |------| | 1 | | 2 | | 3 | |------| | 6 | #+TBLFM: @5$1=vsum(@I..II) Would like to read the results (6) and use it in a equation: MoreProcessing := $result + 1.234 How would one go about doing this? Thanks! Gilles