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

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

[elpa] externals/org afbbebff3f 097/101: org-fold-core-get-folding-spec:


From: ELPA Syncer
Subject: [elpa] externals/org afbbebff3f 097/101: org-fold-core-get-folding-spec: Respect `org-fold-core-style'
Date: Sat, 1 Jul 2023 09:59:17 -0400 (EDT)

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

    org-fold-core-get-folding-spec: Respect `org-fold-core-style'
    
    * lisp/org-fold-core.el (org-fold-core-get-folding-spec): Only
    consider folding using a single (currently selected) folding style.
    
    Multiple fold styles may be present during isearch - we do not want to
    mix them.
---
 lisp/org-fold-core.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 15e4747c61..18551be067 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -786,13 +786,19 @@ corresponding folding spec (if the text is folded using 
that spec)."
        ((eq spec 'all)
         (let ((result))
          (dolist (spec (org-fold-core-folding-spec-list))
-           (let ((val (get-char-property (point) 
(org-fold-core--property-symbol-get-create spec nil t))))
+           (let ((val (if (eq org-fold-core-style 'text-properties)
+                           (get-text-property (point) 
(org-fold-core--property-symbol-get-create spec nil t))
+                         (get-char-property (point) 
(org-fold-core--property-symbol-get-create spec nil t)))))
              (when val (push val result))))
           (reverse result)))
        ((null spec)
-        (let ((result (get-char-property (point) 'invisible)))
+        (let ((result (if (eq org-fold-core-style 'text-properties)
+                          (get-text-property (point) 'invisible)
+                        (get-char-property (point) 'invisible))))
           (when (org-fold-core-folding-spec-p result) result)))
-       (t (get-char-property (point) 
(org-fold-core--property-symbol-get-create spec nil t)))))))
+       (t (if (eq org-fold-core-style 'text-properties)
+              (get-text-property (point) 
(org-fold-core--property-symbol-get-create spec nil t))
+            (get-char-property (point) 
(org-fold-core--property-symbol-get-create spec nil t))))))))
 
 (defun org-fold-core-get-folding-specs-in-region (beg end)
   "Get all folding specs in region from BEG to END."



reply via email to

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