From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rustom Mody Subject: orgmode tables for programmers (was table export to same buffer) Date: Wed, 14 Aug 2013 12:54:04 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8fb1f56c387e5204e3e33fcd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9VRS-00073G-WC for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 03:24:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9VRR-0008SO-LI for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 03:24:26 -0400 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:57048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9VRR-0008SI-E8 for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 03:24:25 -0400 Received: by mail-ob0-f177.google.com with SMTP id f8so1278112obp.36 for ; Wed, 14 Aug 2013 00:24:24 -0700 (PDT) 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: William Henney Cc: emacs-orgmode , Nicolas Goaziou --e89a8fb1f56c387e5204e3e33fcd Content-Type: multipart/alternative; boundary=e89a8fb1f56c387e4e04e3e33fcb --e89a8fb1f56c387e4e04e3e33fcb Content-Type: text/plain; charset=ISO-8859-1 On Mon, Aug 12, 2013 at 11:50 PM, William Henney wrote: > > The template is not strictly necessary - you can just add the required > lines by hand to your C source file. > I think that orgtbl-to-generic should be able to do what you want out of > the box. Maybe the attached example (orgtbl-test.c) might help you. The > idea is that you edit the org table at the top, then "C-u C-u C-c C-c" will > update all the formulae in the table and install the results in your C > source code at the bottom. This is not quite what you originally asked > for, since you have two copies of the data in the file and you have to > remember to only edit the version in the org table. But it is pretty > close. > > Cheers > > Will > > Thanks Will. Ive converted your code to python (attached). I find it works in org 8 but not in 6.33 -- the default for emacs on debian. Is it easy to make it work for earlier org also?? Reason: This question was asked on the python list: thread starting http://mail.python.org/pipermail/python-list/2013-July/653164.html And so it would be good to have an example that works mostly out of the box --e89a8fb1f56c387e4e04e3e33fcb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On M= on, Aug 12, 2013 at 11:50 PM, William Henney <whenney@gmail.com> wrote:

The template is not stric= tly necessary - you can just add the required lines by hand to your C sourc= e file.=A0
I think that orgtbl-to-generic should be able to do what you want out of th= e box. =A0Maybe the attached example (orgtbl-test.c) might help you. =A0The= idea is that you edit the org table at the top, then "C-u C-u C-c C-c= " will update all the formulae in the table and install the results in= your C source code at the bottom. =A0This is not quite what you originally= asked for, since you have two copies of the data in the file and you have = to remember to only edit the version in the org table. =A0But it is pretty = close.=A0

Cheers

Will


Thanks = Will.
Ive converted your code to python= (attached).
I find it works in org 8 b= ut not in 6.33 -- the default for emacs on debian.
Is it easy to make it work for earlier org= also??

Reason: This question was a= sked on the python list: thread starting
http://mail.python.org/pipe= rmail/python-list/2013-July/653164.html
And so it would be good to have an example= that works mostly out of the box

<= /div>
--e89a8fb1f56c387e4e04e3e33fcb-- --e89a8fb1f56c387e5204e3e33fcd Content-Type: application/octet-stream; name="orgtbl.py" Content-Disposition: attachment; filename="orgtbl.py" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkc7lljz1 IyAtKi0gZXZhbDogKG9yZ3RibC1tb2RlKTsgLSotCgoKc3JjdGFibGUgPSAiIiIKIytPUkdUQkw6 IFNFTkQgbXl0YWJsZSBvcmd0YmwtdG8tZ2VuZXJpYyA6c2tpcCAxIDpza2lwY29scyAoMiAzKSA6 bGZtdCAiXHRcIiVzXCIgOiAlcywiCnwgcGFyYW1ldGVyIHwgbnVtZXJhdG9yIHwgZGVub21pbmF0 b3IgfCAgICB2YWx1ZSB8CnwtLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tKy0t LS0tLS0tLS18CnwgYSAgICAgICAgIHwgICAgICAgMy4wIHwgICAgICAgICAxLjAgfCAgMy4wMDAw MCB8CnwgYiAgICAgICAgIHwgICAgICAxNC4wIHwgICAgICAgICA3LjAgfCAgMi4wMDAwMCB8Cnwg YyAgICAgICAgIHwgICAgICAtMi4wIHwgICAgICAgIDE1LjAgfCAtMC4xMzMzMyB8CiMrVEJMRk06 ICQ0PSQyLyQzO2Y1CgoiIiIKCiMgV2l0aCBwb2ludCBpbiBhYm92ZSB0YWJsZSwgIkMtdSBDLXUg Qy1jIEMtYyIgd2lsbCB1cGRhdGUgZm9ybXVsYWUgYW5kIGluc3RhbGwgYXMgcHl0aG9uIHNvdXJj ZS1jb2RlCgoKcHl0YWJsZSA9IHsKICAgICMgQkVHSU4gUkVDRUlWRSBPUkdUQkwgbXl0YWJsZQoJ ImEiIDogMy4wMDAwMCwKCSJiIiA6IDIuMDAwMDAsCgkiYyIgOiAtMC4xMzMzMywKICAgICMgRU5E IFJFQ0VJVkUgT1JHVEJMIG15dGFibGUKICAgICAgICB9CgoKCg== --e89a8fb1f56c387e5204e3e33fcd-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rustom Mody Subject: Re: orgmode tables for programmers (was table export to same buffer) Date: Wed, 14 Aug 2013 17:20:22 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b47215892e3d704e3e6f77a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9ZbA-0004X4-QP for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 07:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9Zb9-00051A-Eq for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 07:50:44 -0400 Received: from mail-oa0-x22a.google.com ([2607:f8b0:4003:c02::22a]:50256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9Zb9-00050w-9I for emacs-orgmode@gnu.org; Wed, 14 Aug 2013 07:50:43 -0400 Received: by mail-oa0-f42.google.com with SMTP id i18so13136599oag.15 for ; Wed, 14 Aug 2013 04:50:42 -0700 (PDT) In-Reply-To: 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 --047d7b47215892e3d704e3e6f77a Content-Type: multipart/alternative; boundary=047d7b47215892e3d304e3e6f778 --047d7b47215892e3d304e3e6f778 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 14, 2013 at 12:54 PM, Rustom Mody wrote: > I find it works in org 8 but not in 6.33 -- the default for emacs on > debian. > Is it easy to make it work for earlier org also?? > > Ok Ive managed to hack up something: The attached works in org 6.33 and 8.0.7 Just one small help needed: How to split the very long line #+ORGTBL SEND mytable... into multiple lines?? Regards Rusi --047d7b47215892e3d304e3e6f778 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On W= ed, Aug 14, 2013 at 12:54 PM, Rustom Mody <rustompmody@gmail.com&g= t; wrote:
I find it works in org 8 bu= t not in 6.33 -- the default for emacs on debian.
Is it easy to make it work for earlier org also?= ?


Ok Ive managed to hac= k up something:=A0 The attached works in org 6.33 and 8.0.7
Just one small help needed:
How to split the very long line

#+ORGTBL SEND mytable...

into multiple l= ines??


Regards
Rusi


--047d7b47215892e3d304e3e6f778-- --047d7b47215892e3d704e3e6f77a Content-Type: application/octet-stream; name="orgtbl6.33.py" Content-Disposition: attachment; filename="orgtbl6.33.py" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hkch02551 IyAtKi0gZXZhbDogKG9yZ3RibC1tb2RlKTsgLSotCgoKc3JjdGFibGUgPSAiIiIKIytPUkdUQkw6 IFNFTkQgbXl0YWJsZSBvcmd0YmwtdG8tZ2VuZXJpYyA6c2tpcCAxIDpza2lwY29scyAoMiAzKSA6 Zm10ICgxICJcdFwiJXNcIiA6ICIpICgyICIlcyIpIDpsc3RhcnQgIlx0IiA6bGVuZCAiLCIKfCBw YXJhbWV0ZXIgfCBudW1lcmF0b3IgfCBkZW5vbWluYXRvciB8ICAgIHZhbHVlIHwKfC0tLS0tLS0t LS0tKy0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0rLS0tLS0tLS0tLXwKfCBhICAgICAgICAgfCAg ICAgICAzLjAgfCAgICAgICAgIDMuMCB8ICAxLjAwMDAwIHwKfCBiICAgICAgICAgfCAgICAgIDE0 LjAgfCAgICAgICAgIDcuMCB8ICAyLjAwMDAwIHwKfCBjICAgICAgICAgfCAgICAgIC0yLjAgfCAg ICAgICAgMTUuMCB8IC0wLjEzMzMzIHwKIytUQkxGTTogJDQ9JDIvJDM7ZjUKCiIiIgoKIyBXaXRo IHBvaW50IGluIGFib3ZlIHRhYmxlLCAiQy11IEMtYyBDLWMiIHdpbGwgCiMgdXBkYXRlIGZvcm11 bGFlIGFuZCBpbnN0YWxsIGFzIHB5dGhvbiBzb3VyY2UtY29kZQoKCnB5dGFibGUgPSB7CiAgICAj IEJFR0lOIFJFQ0VJVkUgT1JHVEJMIG15dGFibGUKCSJhIiA6IDEuMDAwMDAKCSJiIiA6IDIuMDAw MDAKCSJjIiA6IC0wLjEzMzMzCiAgICAjIEVORCBSRUNFSVZFIE9SR1RCTCBteXRhYmxlCiAgICAg ICAgfQoKCgo= --047d7b47215892e3d704e3e6f77a--