[Org] Update and fix docstrings for reporting

This commit is contained in:
Daniel - 2017-12-03 10:17:47 +01:00
parent 5d347b1112
commit 58c786c251
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 17 additions and 15 deletions

View File

@ -968,20 +968,20 @@ Current Task: %`org-clock-current-task; "
(require 'dash) (require 'dash)
(defun db/org-clocking-time-in-range (tstart tend) (defun db/org-clocking-time-in-range (tstart tend)
"Return list of all tasks in the current buffer with their "Return list of all tasks in the current buffer together with
clocking times attached, provied they lie between TSTART and their clocking times that are between TSTART and TEND. The
TEND. The resulting list conists of elements of the form resulting list conists of elements of the form
(MARKER . CLOCK-TIMES) (MARKER . CLOCK-TIMES)
where MARKER is a marker to the begnning of the corresponding where MARKER is a marker to the beginning of the corresponding
heading and CLOCK-TIMES consists of cons cells of the form (START heading and CLOCK-TIMES is a list of cons cells of the
. END), where START and END are the starting and ending times of form (START . END), where START and END are the starting and
a clock line for this task. START and END are times as returned ending times of a clock line for this task. START and END are
by FLOAT-TIME, which see. No truncation with respect to TSTART given as seconds since the epoch, as a floating point number. No
and TEND is done, i.e., START or END may lie outside of these truncation with respect to TSTART and TEND is done, i.e., START
limits, but it is always true that TSTART END TEND or or END may occassionally lie outside of these limits, but it is
TSTART  START TEND." always true that TSTART END TEND or TSTART START TEND."
;; adapted from `org-clock-sum ;; adapted from `org-clock-sum
(when (eq major-mode 'org-mode) (when (eq major-mode 'org-mode)
(let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" (let* ((re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
@ -1038,7 +1038,7 @@ TEND. Each element in this list is of the form
(START END MARKER), (START END MARKER),
where START, END, MARKER are as return from where START, END, MARKER are as returned by
`db/org-clocking-time-in-range, which see. Entries in the `db/org-clocking-time-in-range, which see. Entries in the
resulting list are sorted by START, ascending." resulting list are sorted by START, ascending."
(let (timeline-of-files turned-around-timeline) (let (timeline-of-files turned-around-timeline)
@ -1059,7 +1059,9 @@ resulting list are sorted by START, ascending."
(defun db/org-format-timeline (tstart tend &optional files) (defun db/org-format-timeline (tstart tend &optional files)
"Display timeline of tasks in FILES between TSTART and TEND. "Display timeline of tasks in FILES between TSTART and TEND.
When not given, FILES defaults to `org-agenda-files." When not given, FILES defaults to `org-agenda-files. When
called interactively, START and END are queried with
`org-read-date."
(interactive (list (org-read-date nil nil nil "Start time: ") (interactive (list (org-read-date nil nil nil "Start time: ")
(org-read-date nil nil nil "End time: "))) (org-read-date nil nil nil "End time: ")))
(let ((timeline (db/org-timeline-in-range tstart tend files))) (let ((timeline (db/org-timeline-in-range tstart tend files)))
@ -1097,8 +1099,8 @@ When not given, FILES defaults to `org-agenda-files."
"Format timeline of given DATE. "Format timeline of given DATE.
DATE should be a string of the form %Y-%m-%d. When called DATE should be a string of the form %Y-%m-%d. When called
interactively, this date will be queried with `org-read-date. interactively, this date will be queried with `org-read-date.
The timeline will be formatted for this day, starting at 00:00 The timeline will be formatted for DATE starting at 00:00 and
and ending at 23:61. When not given, FILES defaults to ending at 23:61. When not given, FILES defaults to
`org-agenda-files." `org-agenda-files."
(interactive (list (org-read-date nil nil))) (interactive (list (org-read-date nil nil)))
(db/org-format-timeline (concat date " 00:00") (db/org-format-timeline (concat date " 00:00")