[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 4254a54f88 1/3: org-update-parent-todo-statistics:
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 4254a54f88 1/3: org-update-parent-todo-statistics: Do not modify buffer unnecessarily |
Date: |
Tue, 6 Feb 2024 15:58:38 -0500 (EST) |
branch: externals/org
commit 4254a54f88fde682d6a6d255b7960d20b25ff126
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
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.
---
lisp/org.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index a728f485d7..da315fccb4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -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))))))