[Org] Function stub for merging clock lines into existing file

unfinished.
This commit is contained in:
Daniel - 2018-01-01 15:35:34 +01:00
parent 0d982d66d5
commit 0d2e773d9d
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 19 additions and 0 deletions

View File

@ -1088,6 +1088,25 @@ ending at 23:61. When not given, FILES defaults to
(concat date " 23:61")
files))
(defun db/org-add-clock-line-to-file (id start end)
"Add clock line with START and END time to task identified by ID."
(warn "This function is untested, dont use it for anything serious.")
;; First insert clock line at task
(let ((location (org-id-find id)))
(when (null location)
(user-error "ID %s cannot be found" id))
(org-with-point-at location
(db/org-add-clocking-time start end)))
;; Now find other clocklines and update them: change starting and ending time
;; accordingly, and if the time is completely within the given bounds, delete
;; it.
(let ((start-sec (org-time-string-to-seconds start))
(end-sec (org-time-string-to-seconds end)))
(db/org-map-clock-lines-and-entries
(lambda (line-start line-end)
(error "Not yet implemented."))
(lambda ()))))
;;; End