summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-05-01 19:19:16 +0200
committerBastien Guerry <bzg@altern.org>2012-05-01 19:19:16 +0200
commit3c3402849797d1e67b19ffecb34c210b1753a8a2 (patch)
treebb53aaf7a7e4c7cbe4925649de0ec03fa950f4b7
parent1c4ac932f3a047e7f668307ced8ecb0f78189fdc (diff)
parent0dbe17b8e001b7df079ed4325057f3abfb191138 (diff)
downloadorg-mode-3c3402849797d1e67b19ffecb34c210b1753a8a2.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-table.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index a3d1b4b..c2fdf96 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3313,15 +3313,18 @@ If S is a string representing a number, keep this number."
"Convert a number of seconds to a time string.
If OUTPUT-FORMAT is non-nil, return a number of days, hours,
minutes or seconds."
- (cond ((eq output-format 'days)
- (format "%.3f" (/ (float secs) 86400)))
- ((eq output-format 'hours)
- (format "%.2f" (/ (float secs) 3600)))
- ((eq output-format 'minutes)
- (format "%.1f" (/ (float secs) 60)))
- ((eq output-format 'seconds)
- (format "%d" secs))
- (t (org-format-seconds "%.2h:%.2m:%.2s" secs))))
+ (let* ((secs0 (abs secs))
+ (res
+ (cond ((eq output-format 'days)
+ (format "%.3f" (/ (float secs0) 86400)))
+ ((eq output-format 'hours)
+ (format "%.2f" (/ (float secs0) 3600)))
+ ((eq output-format 'minutes)
+ (format "%.1f" (/ (float secs0) 60)))
+ ((eq output-format 'seconds)
+ (format "%d" secs0))
+ (t (org-format-seconds "%.2h:%.2m:%.2s" secs0)))))
+ (if (< secs 0) (concat "-" res) res)))
(defun org-table-fedit-convert-buffer (function)
"Convert all references in this buffer, using FUNCTION."