            (tend (cond ((stringp tend) (org-time-string-to-seconds tend))
                        ((consp tend) (float-time tend))
                        (t tend)))
-           task-clock-times headline times)
+           task-clock-times times)
       (db/org-map-clock-lines-and-entries
        ;; when on clock line, collect times
        #'(lambda (start end)

      org-clock-auto-clock-resolution 'when-no-clock-is-running
      org-clock-mode-line-total 'auto
      org-clock-report-include-clocking-task t
      org-clock-in-switch-to-state (lambda (kw)
                                     (when (and (not
                                                 (and (boundp 'org-capture-mode)
                                                      org-capture-mode)))
                                       (cond
                                         ((member (org-get-todo-state)
                                                  (list "TODO" "READ"))
                                          "CONT")
                                         ((member (org-get-todo-state)
                                                  (list "GOTO"))
                                          "ATTN")))))

(org-clock-persistence-insinuate)



;;; Custom links for Windows

(when (eq system-type 'windows-nt)
  (org-link-set-parameters "onenote" :follow #'db/org-onenote-open)

  (defun db/org-onenote-open (path)
    "Visit OneNote document on PATH."
    (w32-shell-execute "open" path)))


