From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maciek Starzyk Subject: [PATCH] org-table.el: Calc formulas evaluate to #ERROR. Date: Mon, 4 Jul 2011 01:14:51 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba1efd2cf886a904a7326ae7 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdVsL-0003c3-Q7 for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 19:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdVsK-0006Bv-Uz for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 19:14:53 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:41503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdVsK-0006Br-Rs for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 19:14:52 -0400 Received: by iwn8 with SMTP id 8so5100182iwn.0 for ; Sun, 03 Jul 2011 16:14:51 -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: emacs-orgmode@gnu.org --90e6ba1efd2cf886a904a7326ae7 Content-Type: text/plain; charset=ISO-8859-1 This fixes regression bug introduced in 2e20cf9358deb9579ae6a22bc0deb2a772387194 diff --git a/lisp/org-table.el b/lisp/org-table.el index a7fc863..9724dc2 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2513,13 +2513,13 @@ not overwrite the stored one." (error "#ERROR")) ev (if (numberp ev) (number-to-string ev) ev) ev (if duration (org-table-time-seconds-to-string - (string-to-number ev)))) + (string-to-number ev)) ev)) (or (fboundp 'calc-eval) (error "Calc does not seem to be installed, and is needed to evaluate the formula")) (setq ev (calc-eval (cons form modes) (if numbers 'num)) ev (if duration (org-table-time-seconds-to-string - (string-to-number ev))))) + (string-to-number ev)) ev))) (when org-table-formula-debug (with-output-to-temp-buffer "*Substitution History*" -- Maciek Starzyk --90e6ba1efd2cf886a904a7326ae7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This fixes regression bug introduced in 2e20cf9358deb9579ae6a22bc0deb2a7723= 87194

diff --git a/lisp/org-table.el b/lisp/org-table.el
index a7= fc863..9724dc2 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el=
@@ -2513,13 +2513,13 @@ not overwrite the stored one."
=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0 (error "#ERROR"))
=A0=A0=A0=A0 =A0=A0=A0 =A0 ev (if (numberp ev) (number-to-string ev) ev)=A0=A0=A0=A0 =A0=A0=A0 =A0 ev (if duration (org-table-time-seconds-to-stri= ng
-=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 (string-to-number ev= ))))
+=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 (string-to-number e= v)) ev))
=A0=A0=A0=A0 =A0 (or (fboundp 'calc-eval)
=A0=A0=A0=A0 =A0=A0=A0=A0= =A0 (error "Calc does not seem to be installed, and is needed to evalu= ate the formula"))
=A0=A0=A0=A0 =A0 (setq ev (calc-eval (cons form = modes)
=A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 (if numbers '= ;num))
=A0=A0=A0=A0 =A0=A0=A0 ev (if duration (org-table-time-seconds-to-string -=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0(string-to-number ev)))))
= +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0(string-to-number ev)) ev)))=A0
=A0=A0=A0=A0 (when org-table-formula-debug
=A0=A0=A0=A0 =A0 (wit= h-output-to-temp-buffer "*Substitution History*"


--
Maciek Starzyk
--90e6ba1efd2cf886a904a7326ae7--