From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: [babel] sbe not working properly Date: Thu, 11 Apr 2013 16:26:12 +0200 Message-ID: <2013-04-11T16-21-52@devnull.Karl-Voit.at> Reply-To: news1142@Karl-Voit.at 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]:60554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQISK-0000Xx-Cu for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 10:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQISF-0005Hw-E2 for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 10:26:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:60288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQISF-0005Hm-77 for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 10:26:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQISD-0002Xz-Pv for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 16:26:21 +0200 Received: from mail.michael-prokop.at ([88.198.6.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 16:26:21 +0200 Received: from news1142 by mail.michael-prokop.at with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 16:26:21 +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 want to define a babel function named epoch2day which I am able to use in a table to convert UNIX epoch times to Org-mode time stamps: #+NAME: epoch2day(epoch=1) #+BEGIN_SRC python :results output time = epoch import datetime strtime = str(time) datetimestamp = datetime.datetime.utcfromtimestamp(int(strtime[:10])) print datetimestamp.strftime('[%Y-%m-%d %a %H:%M:%S]') #+END_SRC #+RESULTS: epoch2day : [1970-01-01 Thu 00:00:01] ... this works so far. However, in a table I can't "overwrite" the default value with a column value: | epoch | day | |---------------+---------------------------| | 1262675465119 | [1970-01-01 Thu 00:00:01] | #+TBLFM: $2='(sbe epoch2day (epoch $1)) ... but $2 should be: [2010-01-05 Tue 07:11:05] On [1] I found another example: #+name: add1(x=1) :results silent #+begin_src python return x + 1 #+end_src #+RESULTS: add1 : 2 | foo | bar | 3 | 2 | #+TBLFM: @1$4='(sbe add1 (x $3)) #+CALL: add1(x=2) #+RESULTS: add1(x=2) : 2 So this simple example does not work either at my side[2]. What is my error? Or did I found a bug? Thanks! 1. http://stackoverflow.com/questions/9595310/org-babel-sbe-syntax 2. Org-mode 1af215bb4668bf3e778175e68fcaf from git -- mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode: > get Memacs from https://github.com/novoid/Memacs < https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github