From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Functions in SBE blocks Date: Sat, 7 Jul 2012 20:58:31 +0200 Message-ID: <20120707185831.GA25982@client195-161.wlan.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnaDH-00051O-Sf for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 14:58:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SnaDG-00057c-8l for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 14:58:39 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:46226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnaDF-000572-Un for emacs-orgmode@gnu.org; Sat, 07 Jul 2012 14:58:38 -0400 Received: by bkcjc3 with SMTP id jc3so6684328bkc.0 for ; Sat, 07 Jul 2012 11:58:35 -0700 (PDT) Content-Disposition: inline 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 can't get SBE blocks called from a table to work, if they use functions like org-parse-time-string. Suppose I have the following table: | Start | Ende | | |------------------+------------------+-| | [2011-06-29 Wed] | [2012-02-29 Wed] | | #+TBLFM: $3='(sbe "billable-month" (start $1) (end $2)) and the following source block: #+NAME: billable-month(start="[2011-06-29 Wed]", end="[2012-02-29 Wed]") #+BEGIN_SRC emacs-lisp (let* ((start-date start)) (message "%s" start-date)) #+END_SRC If I evaluate the table, the start date is put into the last column. However, if I change the code to the following: #+NAME: billable-month(start="[2011-06-29 Wed]", end="[2012-02-29 Wed]") #+BEGIN_SRC emacs-lisp (let* ((start-date (org-parse-time-string start))) (message "%s" (nth 4 start-date))) #+END_SRC then the string #ERROR is inserted into the table. Evaluating the source block directly yields the correct result. What's going on here? Thanks, Viktor