                  [:td [:strong story]]
                  [:td.time (u/duration-string v)]]))]])))))
 
-(defn entry-compare
-  "Compare by prio first, then by active-from."
-  [k]
-  (fn [x y]
-    (let [prio-x (get-in x [k :priority] :X)
-          prio-y (get-in y [k :priority] :X)
-          c (compare prio-x prio-y)
-          active-x (get-in x [k :active-from])
-          active-y (get-in y [k :active-from])]
-      (if (not= c 0) c (compare active-x active-y)))))
+(defn habit-sorter
+  "Sorts tasks."
+  [x y]
+  (let [c (compare (get-in x [:habit :priority] :X)
+                   (get-in y [:habit :priority] :X))]
+    (if (not= c 0) c (compare (get-in y [:habit :points])
+                              (get-in x [:habit :points])))))
 
 (defn waiting-habits-list
   "Renders table with open entries, such as started tasks and open habits."

        entries-list
        (reaction
          (let [entries-map @entries-map
                sorter (entry-compare :habit)
                find-missing (u/find-missing-entry entries-map put-fn)
                entries (->> @waiting-habits
                             (map (fn [ts] (find-missing ts)))
                             (sort sorter))
                conf (merge @cfg @options)]
            (if (:show-pvt @cfg)
              entries

                      (name fk)])
        entries-list (reaction
                       (let [entries-map @entries-map
                             find-missing (u/find-missing-entry entries-map put-fn)
                             entries (->> @started-tasks
                                          (map (fn [ts] (find-missing ts)))
                                          (filter on-hold-filter)
                                          (filter saga-filter)
                                          (sort task-sorter))
                             conf (merge @cfg @options)]
                         (if (:show-pvt @cfg)
                           entries
