                            [day {:todos (get m day [])
                                  :calendar-events (get calendar-events day [])
                                  :past-log (get past-log day [])}]))
-                    (into {}))})))
+                    (into {}))
+       :backlog (:backlog m)})))
 
 (let [p (re-pattern (format (str #"(?:%s )?(.*)")
                             (str TODO-state-pattern)))]

                                                             t2 (some-> t2 .toLocalTime)]
                                                         (assoc item
                                                                :timetable-slot [t1 t2]
                                                                :past? past?)))))}])]
    {:deadlines (sort-by (juxt (comp - priority) :created-at :file :line-number) deadlines)
     :triage    (sort-by (juxt (comp - priority) :created-at :file :line-number) triage)
     :today     (second (first not-past))
     :future    (rest not-past)
     :past      (for [[date :as date+item] (reverse (sort by-day))

          all-items (->> (all-sections file)
                         (mapcat #(parse-section-for-agenda % file-str today)))
          calendar-events (->> all-items
                               (filter calendar-event?))
          todos (->> all-items
                     (filter :todo)
                     (map (fn [todo]
                            (let [search (conj (:ancestor-headers todo) (:raw-header todo))]
                              (assoc todo
                                     :descendent-TODOs?
                                     (->> all-items
                                          (filter :todo)
                                          (some (fn [todo]
                                                  (= search (take (count search)
                                                                  (:ancestor-headers todo)))))
                                          (boolean))
                                     :shadowed-by-sibling?
                                     ;; figure out if its parent has "ORDERED" set and
                                     ;; a prior sibling has "TODO"
                                     (boolean
                                      (and (:parent-is-ordered? todo)
                                           (->> all-items
                                                (filter :todo)
                                                (some (fn [todo2]
                                                        (and (= (:ancestor-headers todo)
                                                                (:ancestor-headers todo2))
                                                             (< (:line-number todo2)
                                                                (:line-number todo)))))))))))))]
      {:todos   todos
       :todones (->> all-items
                     (filter :done))
       :calendar-events calendar-events})
    (catch FileNotFoundException e
      (log/warn "FileNotFoundException")
      {:todos [] :todones [] :calendar-events []})))


(defn synthesize-agenda
