1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

Fix indirect buffer tracking

* lisp/org-fold-core.el
(org-fold-core-decouple-indirect-buffer-folds): Actually, add newly
created indirect buffer to the tracked list.
This commit is contained in:
Ihor Radchenko 2024-06-10 11:13:58 +02:00
parent bb3800f904
commit 4d4d59874c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -641,13 +641,14 @@ This function is mostly intended to be used in
`clone-indirect-buffer-hook'."
;; Add current buffer to the list of indirect buffers in the base buffer.
(when (buffer-base-buffer)
(with-current-buffer (buffer-base-buffer)
(setq-local org-fold-core--indirect-buffers
(let (bufs)
(org-fold-core-cycle-over-indirect-buffers
(push (current-buffer) bufs))
(push (current-buffer) bufs)
(delete-dups bufs)))))
(let ((new-buffer (current-buffer)))
(with-current-buffer (buffer-base-buffer)
(setq-local org-fold-core--indirect-buffers
(let (bufs)
(org-fold-core-cycle-over-indirect-buffers
(push (current-buffer) bufs))
(push new-buffer bufs)
(delete-dups bufs))))))
(when (and (buffer-base-buffer)
(eq org-fold-core-style 'text-properties)
(not (memql 'ignore-indirect org-fold-core--optimise-for-huge-buffers)))