summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-28 18:22:38 +0200
committerBastien Guerry <bzg@altern.org>2012-09-28 18:22:38 +0200
commitb1f498487afc8177e68c663323344d585780928b (patch)
tree32049d0141f15f736624bbbdfb4872d4ee5ac23f
parentecdc4d14c8ee63fbc8c2b8975a494b5afc9f6ea7 (diff)
downloadorg-mode-b1f498487afc8177e68c663323344d585780928b.tar.gz
org-table.el: Convert time-stamps to inactive time-stamp so that Calc can handle them correctly
* org-table.el (org-table-eval-formula): Convert time-stamps to inactive time-stamp so that Calc can handle them correctly. Thanks to Daniel E. Doherty for reporting this.
-rw-r--r--lisp/org-table.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index fa7ffd2..3eb63b6 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2604,6 +2604,8 @@ not overwrite the stored one."
duration-output-format) ev))
(or (fboundp 'calc-eval)
(error "Calc does not seem to be installed, and is needed to evaluate the formula"))
+ ;; "Inactivate" time-stamps so that Calc can handle them
+ (setq form (replace-regexp-in-string org-ts-regexp3 "<\\1>" form))
(setq ev (if (and duration (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" form))
form
(calc-eval (cons form org-tbl-calc-modes) (if numbers 'num)))