Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2018-02-14 18:00:38 +01:00
commit af824a9b39
1 changed files with 20 additions and 15 deletions

View File

@ -2022,27 +2022,32 @@ fontified, and then returned."
;;;###autoload ;;;###autoload
(defun org-clock-report (&optional arg) (defun org-clock-report (&optional arg)
"Create a table containing a report about clocked time. "Update or create a table containing a report about clocked time.
If the cursor is inside an existing clocktable block, then the table
will be updated. If not, a new clocktable will be inserted. The scope
of the new clock will be subtree when called from within a subtree, and
file elsewhere.
When called with a prefix argument, move to the first clock table in the If point is inside an existing clocktable block, update it.
buffer and update it." Otherwise, insert a new one.
The new table inherits its properties from the variable
`org-clock-clocktable-default-properties'. The scope of the
clocktable, when not specified in the previous variable, is
`subtree' when the function is called from within a subtree, and
`file' elsewhere.
When called with a prefix argument, move to the first clock table
in the buffer and update it."
(interactive "P") (interactive "P")
(org-clock-remove-overlays) (org-clock-remove-overlays)
(when arg (when arg
(org-find-dblock "clocktable") (org-find-dblock "clocktable")
(org-show-entry)) (org-show-entry))
(if (org-in-clocktable-p) (pcase (org-in-clocktable-p)
(goto-char (org-in-clocktable-p)) (`nil
(let ((props (if (ignore-errors
(save-excursion (org-back-to-heading)))
(list :name "clocktable" :scope 'subtree)
(list :name "clocktable"))))
(org-create-dblock (org-create-dblock
(org-combine-plists org-clock-clocktable-default-properties props)))) (org-combine-plists
(list :scope (if (org-before-first-heading-p) 'file 'subtree))
org-clock-clocktable-default-properties
'(:name "clocktable"))))
(start (goto-char start)))
(org-update-dblock)) (org-update-dblock))
(defun org-day-of-week (day month year) (defun org-day-of-week (day month year)