From 10e239f434e63ce5e0b4b242911357536dad98fe Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 25 Mar 2013 11:48:21 +0100 Subject: [PATCH] Work around calc-eval regression * lisp/org-table.el (org-table-eval-formula): Work-around for calc-eval regression. Calc-eval can no longer be called without initializing the *Calculator* buffer first. --- lisp/org-table.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index f087cf7c4..86d3f7637 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2701,7 +2701,6 @@ not overwrite the stored one." (org-table-make-reference x keep-empty numbers lispp)) t t form))) - (if lispp (setq ev (condition-case nil (eval (eval (read form))) @@ -2712,6 +2711,10 @@ not overwrite the stored one." duration-output-format) ev)) (or (fboundp 'calc-eval) (user-error "Calc does not seem to be installed, and is needed to evaluate the formula")) + (or (get-buffer "*Calculator*") + (progn + (require 'calc) + (save-window-excursion (calc)))) ;; Use <...> time-stamps so that Calc can handle them (setq form (replace-regexp-in-string org-ts-regexp3 "<\\1>" form)) ;; I18n-ize local time-stamps by setting (system-time-locale "C")