Skip to content

Commit e9781f1

Browse files
committed
org-fold-core: Respect 'ignore-indirect optimization better
* lisp/org-fold-core.el (org-fold-core--property-symbol-get-create): (org-fold-core-decouple-indirect-buffer-folds): Do not try to decouple folding state in indirect buffers when 'ignore-indirect is requested in `org-fold-core--optimise-for-huge-buffers'.
1 parent 791ea50 commit e9781f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lisp/org-fold-core.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ unless RETURN-ONLY is non-nil."
552552
org-fold-core--property-symbol-cache))))
553553
(prog1
554554
local-prop
555-
(unless return-only
555+
(unless (or return-only
556+
(memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers))
556557
(with-current-buffer buf
557558
;; Update folding properties carried over from other
558559
;; buffer (implying that current buffer is indirect
@@ -623,9 +624,11 @@ unless RETURN-ONLY is non-nil."
623624

624625
(defun org-fold-core-decouple-indirect-buffer-folds ()
625626
"Copy and decouple folding state in a newly created indirect buffer.
626-
This function is mostly indented to be used in `clone-indirect-buffer-hook'."
627+
This function is mostly intended to be used in
628+
`clone-indirect-buffer-hook'."
627629
(when (and (buffer-base-buffer)
628-
(eq org-fold-core-style 'text-properties))
630+
(eq org-fold-core-style 'text-properties)
631+
(not (memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers)))
629632
(org-fold-core--property-symbol-get-create (car (org-fold-core-folding-spec-list)))))
630633

631634
;;; API

0 commit comments

Comments
 (0)