org-fold-core-cycle-over-indirect-buffers: Fix missing indirect capture buffers

* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
Fix logic detecting foreign `org-fold-core--indirect-buffers'.
`current-buffer' is not always at `car'.  Before this change, capture
buffers could be missed when cycling over indirect buffers causing
subtle bugs.

Reported-by: Alexandros Prekates <aprekates@posteo.net>
Link: https://orgmode.org/list/20221128122841.2246aa08@enous
This commit is contained in:
Ihor Radchenko 2022-12-04 15:58:44 +03:00
parent 4564627415
commit 461eb2a0ec
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -497,7 +497,7 @@ hanging around."
(declare (debug (form body)) (indent 0))
`(let (buffers dead-properties)
(if (and (not (buffer-base-buffer))
(not (eq (current-buffer) (car org-fold-core--indirect-buffers))))
(not (memq (current-buffer) org-fold-core--indirect-buffers)))
;; We are in base buffer with `org-fold-core--indirect-buffers' value from
;; different buffer. This can happen, for example, when
;; org-capture copies local variables into *Capture* buffer.