emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org acf6fa6209 2/5: org-fold-core--property-symbol-get-


From: ELPA Syncer
Subject: [elpa] externals/org acf6fa6209 2/5: org-fold-core--property-symbol-get-create: Improve performance
Date: Sat, 16 Mar 2024 06:58:52 -0400 (EDT)

branch: externals/org
commit acf6fa6209e5a5d9a997c9c40f08a663194479ed
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-fold-core--property-symbol-get-create: Improve performance
    
    * lisp/org-fold-core.el (org-fold-core--property-symbol-get-create):
    Cache values of global property symbols.
---
 lisp/org-fold-core.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index dda982204e..c99ab2f519 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -554,7 +554,10 @@ and the setup appears to be created for different buffer,
 copy the old invisibility state into new buffer-local text properties,
 unless RETURN-ONLY is non-nil."
   (if (eq org-fold-core-style 'overlays)
-      (org-fold-core-get-folding-property-symbol spec nil 'global)
+      (or (gethash (cons 'global spec) org-fold-core--property-symbol-cache)
+          (puthash (cons 'global spec)
+                   (org-fold-core-get-folding-property-symbol spec nil 'global)
+                   org-fold-core--property-symbol-cache))
     (let* ((buf (or buffer (current-buffer))))
       ;; Create unique property symbol for SPEC in BUFFER
       (let ((local-prop (or (gethash (cons buf spec) 
org-fold-core--property-symbol-cache)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]