Subject: bug#58928: 29.0.50; overlays in org-mode are disrupted after call `org-capture`

From: Gerd Möllmann <[email-masked]>
Date: Tue, 1 Nov 2022 10:20:37 +0100

On 01.11.22 10:07, Ihor Radchenko wrote:
> Gerd Möllmann <[email-masked]> writes:
> 
>> What I see now is that I have 2 windows.  One is showing test.org, the
>> other is a buffer CAPTURE-test.org.  While typing in CAPTURE-test.org,
>> the text in test.org is mangled with each key stroke.  The invisible
>> parts (...) are moved around in test.org.  C-l doesn't change anything.
>>
>> Running with --enable-checking and ASAN doesn't show anything.
>>
>> Do we have someone who knows Org internals, and can tell what exactly
>> typing in CAPTURE-test.org does, presumably with overlays?
> 
> I cannot reproduce using somewhat old Emacs 29
> Development version 41d3d71a1e67 on master branch; build date 2022-10-28.
> 
> I can reproduce after updating to the latest master.
> 
> FYI, CAPTURE-test.org is nothing but a narrowed indirect buffer.
> In this particular case, CAPTURE-test.org is narrowed to 1..4 before you
> start typing. You can widen it and will see that it is still the
> original Org file.
> 
> Note that test.org itself is also narrowed, which should not happen.
> Although, narrowing of test.org during capture can also be seen using
> Emacs 28.
> 

Thanks for looking into this, Ihor!

I don't know, but my guess is that the indirect buffer thing is already
a good starting point for Stefan/Matt.