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>
This commit is contained in:
Nicolas Goaziou 2018-06-19 16:29:30 +02:00
parent 0dd2985509
commit fc5ee0f87b
2 changed files with 2 additions and 11 deletions

View File

@ -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. |

View File

@ -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)