summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-21 10:25:44 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-21 10:25:44 +0200
commit8fc25eb409c09d03cad7f36107bb571eba20d1ce (patch)
tree0b8a8f742b7a8550a50dc23abfe2aee76cbea997
parenteb9fb15b2d0be29bfa4f0dceeaa41c8f5552b7ab (diff)
downloadorg-mode-8fc25eb409c09d03cad7f36107bb571eba20d1ce.tar.gz
org-table: Assume `calc-eval' is always available
* lisp/org-table.el (org-table-maybe-eval-formula): (org-table-eval-formula): Assume `calc-eval' is always available, which is the case on any recent GNU Emacs.
-rw-r--r--lisp/org-table.el10
1 files changed, 3 insertions, 7 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 7da74f3..6713f6f 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2380,11 +2380,8 @@ If yes, store the formula and apply it."
(when (string-match "^:?=\\(.*[^=]\\)$" field)
(setq named (equal (string-to-char field) ?:)
eq (match-string 1 field))
- (if (or (fboundp 'calc-eval)
- (equal (substring eq 0 (min 2 (length eq))) "'("))
- (org-table-eval-formula (if named '(4) nil)
- (org-table-formula-from-user eq))
- (user-error "Calc does not seem to be installed, and is needed to evaluate the formula"))))))
+ (org-table-eval-formula (and named '(4))
+ (org-table-formula-from-user eq))))))
(defvar org-recalc-commands nil
"List of commands triggering the recalculation of a line.
@@ -2849,8 +2846,7 @@ not overwrite the stored one. SUPPRESS-ANALYSIS prevents any call to
ev (if duration (org-table-time-seconds-to-string
(string-to-number ev)
duration-output-format) ev))
- (or (fboundp 'calc-eval)
- (user-error "Calc does not seem to be installed, and is needed to evaluate the formula"))
+
;; Use <...> time-stamps so that Calc can handle them
(while (string-match (concat "\\[" org-ts-regexp1 "\\]") form)
(setq form (replace-match "<\\1>" nil nil form)))