Fix stacking of summed effort estimations upon agenda refresh
When refreshing the Org agenda without completing redrawing it (i.e, by calling `org-agenda-filter-by-tag`), effort estimates where added for every refreshing, causing them to stack up. We now check whether a summed effort estimate is already present and remove it before adding it again. (Maybe one could also just skip the effort recalculation if the a summed effort estimate is already present, but I am not sure whether this will cause display inconsistencies when new events are added or old ones are deleted.)
This commit is contained in:
parent
6ed088d2da
commit
28b2047ad6
@ -218,6 +218,17 @@ Add this function to `org-agenda-finalize-hook' to enable this."
|
|||||||
(point) (point-max) 'org-agenda-date-header t))
|
(point) (point-max) 'org-agenda-date-header t))
|
||||||
(goto-char pos)
|
(goto-char pos)
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
|
|
||||||
|
;; When there is already an effort sum shown, delete it first
|
||||||
|
(when (re-search-backward " ([0-9]+:[0-9]\\{2\\})"
|
||||||
|
(save-mark-and-excursion
|
||||||
|
;; Only search until start of line
|
||||||
|
(beginning-of-line)
|
||||||
|
(point))
|
||||||
|
t)
|
||||||
|
(kill-line))
|
||||||
|
|
||||||
|
;; Insert effort sum
|
||||||
(insert-and-inherit
|
(insert-and-inherit
|
||||||
(concat " ("
|
(concat " ("
|
||||||
(db/org-agenda-calculate-efforts
|
(db/org-agenda-calculate-efforts
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user