 (defun db/update-org-agenda-files (symbol value)
   "Set SYMBOL to VALUE and update `org-agenda-files’ afterwards."
   (set-default symbol value)
-  (setq org-agenda-files (remove-duplicates
+  (setq org-agenda-files (cl-remove-duplicates
                           (cl-remove-if #'string-empty-p
                                         (mapcar (lambda (symbol)
                                                   (when (boundp symbol)

  ;; Things copied from `org-clock-update-time-maybe’
  (let* ((s (-
             (float-time
              (apply #'encode-time (org-parse-time-string stamp-2 nil t)))
             (float-time
              (apply #'encode-time (org-parse-time-string stamp-1 nil t)))))
         (neg (< s 0))
         (s (abs s))
         (h (floor (/ s 3600)))

A slot is short if it is not longer than THRESHOLD seconds.
Resulting gaps are distributed evenly among adjacent slots."
  (let ((start (first (first timeline)))
        (end (second (car (last timeline))))
        new-timeline)
    ;; remove all slots that are too short
    (setq new-timeline
          (cl-remove-if (lambda (entry)
                          (<= (- (second entry) (first entry))
                              threshold))
                        timeline))

    ;; reset start and end times
    (setf (first (first new-timeline)) start)
