[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 169333e1cb 2/2: org-footnote-sort: Improve
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 169333e1cb 2/2: org-footnote-sort: Improve performance |
Date: |
Sat, 10 Dec 2022 05:58:07 -0500 (EST) |
branch: externals-release/org
commit 169333e1cbb50f74c613deefb8c60c9859765c62
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-footnote-sort: Improve performance
* lisp/org-footnote.el (org-footnote-sort): Group inserting the
footnote definitions into a single cache update request. This should
improve performance.
Reported-by: arozbiz@gmail.com
Link:
https://orgmode.org/list/CAJniy+MW330e8SLog4DHxzS8wvZ3OCzuwbKhUrdTCgpvtd3pkQ@mail.gmail.com
---
lisp/org-footnote.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index aedd413351..ac78360aef 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -851,9 +851,12 @@ to `org-footnote-section'. Inline definitions are
ignored."
(format "[fn:%s] DEFINITION NOT FOUND." label))
"\n"))))
;; Insert un-referenced footnote definitions at the end.
- (pcase-dolist (`(,label . ,definition) definitions)
- (unless (member label inserted)
- (insert "\n" definition "\n")))))))))
+ ;; Combine all insertions into one to create a single cache
+ ;; update call.
+ (combine-change-calls (point) (point)
+ (pcase-dolist (`(,label . ,definition) definitions)
+ (unless (member label inserted)
+ (insert "\n" definition "\n"))))))))))
(defun org-footnote-normalize ()
"Turn every footnote in buffer into a numbered one."