summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-06-19 16:29:30 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-10-03 18:44:34 +0200
commitfc5ee0f87bd940d0b7cdaa123f71d7ab0d9db350 (patch)
tree4fffd41435b360abd9c970f4e411e96b063121e3
parent0dd29855090ae54946ff4cabb23dfc83d002fc23 (diff)
downloadorg-mode-fc5ee0f87bd940d0b7cdaa123f71d7ab0d9db350.tar.gz
org-colview: Plain numbers are minutes instead of hours
* lisp/org-colview.el (org-columns--summary-apply-times): Use the same rule as everywhere else in Org. * doc/org-manual.org (Column attributes): Document change. Reported-by: Bernt Hansen <bernt@norang.ca> <http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00294.html>
-rw-r--r--doc/org-manual.org2
-rw-r--r--lisp/org-colview.el11
2 files changed, 2 insertions, 11 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 9db0092..917c05a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -5404,7 +5404,7 @@ optional. The individual parts have the following meaning:
| =X= | Checkbox status, =[X]= if all children are =[X]=. |
| =X/= | Checkbox status, =[n/m]=. |
| =X%= | Checkbox status, =[n%]=. |
- | =:= | Sum times, HH:MM, plain numbers are hours. |
+ | =:= | Sum times, HH:MM, plain numbers are minutes. |
| =:min= | Smallest time value in column. |
| =:max= | Largest time value. |
| =:mean= | Arithmetic mean of time values. |
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 9322758..61a360e 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1110,16 +1110,7 @@ as a canonical duration, i.e., using units defined in
"Apply FUN to time values TIMES.
Return the result as a duration."
(org-duration-from-minutes
- (apply fun
- (mapcar (lambda (time)
- ;; Unlike to `org-duration-to-minutes' standard
- ;; behavior, we want to consider plain numbers as
- ;; hours. As a consequence, we treat them
- ;; differently.
- (if (string-match-p "\\`[0-9]+\\(?:\\.[0-9]*\\)?\\'" time)
- (* 60 (string-to-number time))
- (org-duration-to-minutes time)))
- times))
+ (apply fun (mapcar #'org-duration-to-minutes times))
(org-duration-h:mm-only-p times)))
(defun org-columns--compute-spec (spec &optional update)