org-update-parent-todo-statistics: Do not modify buffer unnecessarily
* lisp/org.el (org-update-parent-todo-statistics): When the updated statistics cookie is unchanged, do not modify buffer. This prevents unnecessary queries to element cache.
This commit is contained in:
parent
10d2868c58
commit
4254a54f88
|
@ -9829,10 +9829,11 @@ statistics everywhere."
|
|||
(max 1 cnt-all)))
|
||||
(format "[%d/%d]" cnt-done cnt-all))
|
||||
ndel (- (match-end 0) checkbox-beg))
|
||||
(goto-char checkbox-beg)
|
||||
(insert new)
|
||||
(delete-region (point) (+ (point) ndel))
|
||||
(when org-auto-align-tags (org-fix-tags-on-the-fly))))
|
||||
(unless (string-equal new (buffer-substring checkbox-beg (match-end 0)))
|
||||
(goto-char checkbox-beg)
|
||||
(insert new)
|
||||
(delete-region (point) (+ (point) ndel))
|
||||
(when org-auto-align-tags (org-fix-tags-on-the-fly)))))
|
||||
(when cookie-present
|
||||
(run-hook-with-args 'org-after-todo-statistics-hook
|
||||
cnt-done (- cnt-all cnt-done))))))
|
||||
|
|
Loading…
Reference in New Issue