Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Ihor Radchenko
Michael Dauer  writes:

> Maybe it helps to share you other fix there?

Feel free to share it. Basically, it should be enough to ask testing
using Org dev branch.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Michael Dauer
Maybe it helps to share you other fix there?

Am Mi., 9. Aug. 2023 um 11:14 Uhr schrieb Michael Dauer <
mick.da...@gmail.com>:

> I don't know how to get swiper activated in a "clean" manner from there.
> In my operational set-up everything is based on straight.
>
> But anyhow it seems to be a known issue in the swiper community:
> https://github.com/abo-abo/swiper/issues/3015
>
> Am Di., 8. Aug. 2023 um 19:09 Uhr schrieb Ihor Radchenko <
> yanta...@posteo.net>:
>
>> Michael Dauer  writes:
>>
>> > The issue is still easy to reproduce:
>> 
>> > * h1
>> > a
>> > * h2
>> > b
>> > * h3
>> > b
>> > * h4
>> > c
>> > <<<
>> > Fold all. On * h1 call swiper-isearch, enter bbb and select the first
>> > match. -> h2 cannot be unfold anymore.
>> > If you repeat it and select the second match then h3 cannot be unfold
>> > anymore, but h2 works again.
>> > (org-fold-core--clear-isearch-overlays) still fixes the buffer.
>>
>> Sorry, but I cannot reproduce.
>> May you please provide more detailed steps starting from emacs -Q?
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>


Re: BUG: org-cycle does not unfold some subtrees

2023-08-09 Thread Michael Dauer
I don't know how to get swiper activated in a "clean" manner from there. In
my operational set-up everything is based on straight.

But anyhow it seems to be a known issue in the swiper community:
https://github.com/abo-abo/swiper/issues/3015

Am Di., 8. Aug. 2023 um 19:09 Uhr schrieb Ihor Radchenko <
yanta...@posteo.net>:

> Michael Dauer  writes:
>
> > The issue is still easy to reproduce:
> 
> > * h1
> > a
> > * h2
> > b
> > * h3
> > b
> > * h4
> > c
> > <<<
> > Fold all. On * h1 call swiper-isearch, enter bbb and select the first
> > match. -> h2 cannot be unfold anymore.
> > If you repeat it and select the second match then h3 cannot be unfold
> > anymore, but h2 works again.
> > (org-fold-core--clear-isearch-overlays) still fixes the buffer.
>
> Sorry, but I cannot reproduce.
> May you please provide more detailed steps starting from emacs -Q?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-08-08 Thread Ihor Radchenko
Michael Dauer  writes:

> The issue is still easy to reproduce:

> * h1
> a
> * h2
> b
> * h3
> b
> * h4
> c
> <<<
> Fold all. On * h1 call swiper-isearch, enter bbb and select the first
> match. -> h2 cannot be unfold anymore.
> If you repeat it and select the second match then h3 cannot be unfold
> anymore, but h2 works again.
> (org-fold-core--clear-isearch-overlays) still fixes the buffer.

Sorry, but I cannot reproduce.
May you please provide more detailed steps starting from emacs -Q?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-08-08 Thread Michael Dauer
The issue is still easy to reproduce:
>>>
* h1
a
* h2
b
* h3
b
* h4
c
<<<
Fold all. On * h1 call swiper-isearch, enter bbb and select the first
match. -> h2 cannot be unfold anymore.
If you repeat it and select the second match then h3 cannot be unfold
anymore, but h2 works again.
(org-fold-core--clear-isearch-overlays) still fixes the buffer.

Am Fr., 4. Aug. 2023 um 16:11 Uhr schrieb William Denton :

> On 4 August 2023, Michael Dauer wrote:
>
> > I'm on main (Org mode version 9.7-pre (release_9.6.7-594-gf03b83), and
> it's
> > not fixed. Am I missing something?
>
> The fix did fix it for me, and the problem went away.  It did seem to
> introduce
> a new problem with searching in a buffer with Swiper, where the search
> would
> fail or throw an error or require me to collapse headings before it would
> work,
> but that hasn't happened in a while and I didn't try to debug it.
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
> CO₂: 421.92 ppm (Mauna Loa Observatory, 2023-08-03)


Re: BUG: org-cycle does not unfold some subtrees

2023-08-04 Thread William Denton

On 4 August 2023, Michael Dauer wrote:


I'm on main (Org mode version 9.7-pre (release_9.6.7-594-gf03b83), and it's
not fixed. Am I missing something?


The fix did fix it for me, and the problem went away.  It did seem to introduce 
a new problem with searching in a buffer with Swiper, where the search would 
fail or throw an error or require me to collapse headings before it would work, 
but that hasn't happened in a while and I didn't try to debug it.



Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.92 ppm (Mauna Loa Observatory, 2023-08-03)

Re: BUG: org-cycle does not unfold some subtrees

2023-08-04 Thread Ihor Radchenko
Michael Dauer  writes:

> I'm on main (Org mode version 9.7-pre (release_9.6.7-594-gf03b83), and it's
> not fixed. Am I missing something?

If I try to follow the recipe described in
https://list.orgmode.org/orgmode/CAP7OBx+L11ck3Ni6rv94HGU3otdj6C4rG-rMDzkwR1LTj=b...@mail.gmail.com/
using the latest main, I cannot reproduce the problem.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-08-04 Thread Michael Dauer
I'm on main (Org mode version 9.7-pre (release_9.6.7-594-gf03b83), and it's
not fixed. Am I missing something?

Am Do., 1. Juni 2023 um 13:33 Uhr schrieb Ihor Radchenko <
yanta...@posteo.net>:

> Michael Dauer  writes:
>
> > I think I found a way to consistently reproduce the issue:
> > ...
>
> Thanks!
> I now came up with another, more reliable, workaround.
> Since `query-replace', evil, and swiper all arrange the call of
> `isearch-clean-overlays', I can advice it to make sure that we clean
> everything at the end.
>
> Fixed, hopefully, on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7dee2c07f
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-06-01 Thread Ihor Radchenko
Michael Dauer  writes:

> I think I found a way to consistently reproduce the issue:
> ...

Thanks!
I now came up with another, more reliable, workaround.
Since `query-replace', evil, and swiper all arrange the call of
`isearch-clean-overlays', I can advice it to make sure that we clean
everything at the end.

Fixed, hopefully, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7dee2c07f

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-14 Thread Gregor Zattler
Hi Michael, Ihor, ...
* Michael Dauer  [2023-05-14; 12:56 +02]:
> I think I found a way to consistently reproduce the issue:

> * h1
> a
> * h2
> b
> * h3
> b
> * h4
> c
> <<<
> Collapse all. All is fine at this time.
> At pos-min call (query-replace) bbb -> zzz: Already when asking whether to
> replace it cannot expand. h2 and h3 are expansion is broken.

I confirm this recipe.  For me and with my
configuration, as with emacs -Q, I then cannot unfold
h2.

> (org-fold-core--clear-isearch-overlays) repairs it.

This is also the case with my configuration, as with
emacs -Q.

Then I can unfold all headings and see that the
replacement bbb --> zzz worked.


GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0) of 
2023-05-04
Org mode version 9.7-pre (release_9.6.5-357-g080710 @ 
/home/grfz/src/org-mode/lisp/)


Ciao; Gregor



Re: BUG: org-cycle does not unfold some subtrees

2023-05-14 Thread Michael Dauer
I think I found a way to consistently reproduce the issue:
>>>
* h1
a
* h2
b
* h3
b
* h4
c
<<<
Collapse all. All is fine at this time.
At pos-min call (query-replace) bbb -> zzz: Already when asking whether to
replace it cannot expand. h2 and h3 are expansion is broken.
(org-fold-core--clear-isearch-overlays) repairs it.
At pos-max (query-replace) bbb -> zzz does not find a match, and does not
break the expansion.


Am Do., 11. Mai 2023 um 11:47 Uhr schrieb Ihor Radchenko <
yanta...@posteo.net>:

> William Denton  writes:
>
> >> Does it also help if you run M-:
> (org-fold-core--clear-isearch-overlays)?
> >
> > That worked!  I just had the problem.  I ran that, and the tree popped
> open!
>
> Do you use evil-mode?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-12 Thread Thomas Dye
Apologies. This message sent from my phone. Yes, I use swiper. My folding 
problems went away when I set org-fold-core-style to ‘overlay. Limited testing. 

Tom

> On May 13, 2023, at 6:14 AM, Ihor Radchenko  wrote:
> 
> William Denton  writes:
> 
>> No and no, but now that I'm thinking about searching, I remember I use 
>> Swiper 
>> (and Ivy and Counsel).¹  C-s runs =swiper=, which is =isearch-forward= "with 
>> an overview," as it 
>> describes itself.
>> 
>> If we've narrowed it down to searching, could it be connected to that?  To 
>> the 
>> other people with this problem: do you use Swiper?
> 
> I am looking at
> https://github.com/abo-abo/swiper/blob/master/swiper.el#L980 and I note
> that swiper calls `isearch-filter-predicate', but not
> `isearch-mode-end-hook', which indeed explains why the isearch overlays
> are not converted back to proper Org folds.
> 
> Does it help if you try the following variant of 
> `org-fold-core--isearch-filter-predicate-overlays':
> 
> (defun org-fold-core--isearch-filter-predicate-overlays (beg end)
>  "Return non-nil if text between BEG and END is deemed visible by isearch.
> This function is intended to be used as `isearch-filter-predicate'."
>  (when isearch-mode (org-fold-core--create-isearch-overlays beg end)) ;; 
> trick isearch by creating overlays in place of invisible text
>  (isearch-filter-visible beg end))
> 
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
> 




Re: BUG: org-cycle does not unfold some subtrees

2023-05-12 Thread Ihor Radchenko
William Denton  writes:

> No and no, but now that I'm thinking about searching, I remember I use Swiper 
> (and Ivy and Counsel).¹  C-s runs =swiper=, which is =isearch-forward= "with 
> an overview," as it 
> describes itself.
>
> If we've narrowed it down to searching, could it be connected to that?  To 
> the 
> other people with this problem: do you use Swiper?

I am looking at
https://github.com/abo-abo/swiper/blob/master/swiper.el#L980 and I note
that swiper calls `isearch-filter-predicate', but not
`isearch-mode-end-hook', which indeed explains why the isearch overlays
are not converted back to proper Org folds.

Does it help if you try the following variant of 
`org-fold-core--isearch-filter-predicate-overlays':

(defun org-fold-core--isearch-filter-predicate-overlays (beg end)
  "Return non-nil if text between BEG and END is deemed visible by isearch.
This function is intended to be used as `isearch-filter-predicate'."
  (when isearch-mode (org-fold-core--create-isearch-overlays beg end)) ;; trick 
isearch by creating overlays in place of invisible text
  (isearch-filter-visible beg end))

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-12 Thread William Denton

On 12 May 2023, Ihor Radchenko wrote:


What is the value of `isearch-mode-end-hook' in your Org buffers?


(anzu--reset-mode-line org-fold-core--clear-isearch-overlays t)
Local in buffer conforguration.org; global value is nil

I checked in a few buffers, and it always says it's local in that buffer, with
global value of nil, if that matters.


This looks right.

I am wondering how it could be that `isearch-mode-end-hook' does not get
called.

Have you experienced slowness of isearch? Did you abort it in any
special ways?


No and no, but now that I'm thinking about searching, I remember I use Swiper 
(and Ivy and Counsel).¹  C-s runs =swiper=, which is =isearch-forward= "with an overview," as it 
describes itself.


If we've narrowed it down to searching, could it be connected to that?  To the 
other people with this problem: do you use Swiper?


Bill

¹ https://github.com/abo-abo/swiper

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 423.90 ppm (Mauna Loa Observatory, 2023-05-11)

Re: BUG: org-cycle does not unfold some subtrees

2023-05-12 Thread Ihor Radchenko
William Denton  writes:

>> What is the value of `isearch-mode-end-hook' in your Org buffers?
>
> (anzu--reset-mode-line org-fold-core--clear-isearch-overlays t)
> Local in buffer conforguration.org; global value is nil
>
> I checked in a few buffers, and it always says it's local in that buffer, 
> with 
> global value of nil, if that matters.

This looks right.

I am wondering how it could be that `isearch-mode-end-hook' does not get
called.

Have you experienced slowness of isearch? Did you abort it in any
special ways?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-11 Thread William Denton

On 11 May 2023, Ihor Radchenko wrote:


William Denton  writes:


Do you use evil-mode?


Definitely not.


Curious.
This function is supposed to be run upon finishing or aborting isearch.
What is the value of `isearch-mode-end-hook' in your Org buffers?


(anzu--reset-mode-line org-fold-core--clear-isearch-overlays t)
Local in buffer conforguration.org; global value is nil

I checked in a few buffers, and it always says it's local in that buffer, with 
global value of nil, if that matters.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.32 ppm (Mauna Loa Observatory, 2023-05-10)

Re: BUG: org-cycle does not unfold some subtrees

2023-05-11 Thread Ihor Radchenko
William Denton  writes:

>> Do you use evil-mode?
>
> Definitely not.

Curious.
This function is supposed to be run upon finishing or aborting isearch.
What is the value of `isearch-mode-end-hook' in your Org buffers?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-11 Thread William Denton

On 11 May 2023, Ihor Radchenko wrote:


William Denton  writes:


Does it also help if you run M-: (org-fold-core--clear-isearch-overlays)?


That worked!  I just had the problem.  I ran that, and the tree popped open!


Do you use evil-mode?


Definitely not.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.17 ppm (Mauna Loa Observatory, 2023-05-09)

Re: BUG: org-cycle does not unfold some subtrees

2023-05-11 Thread Ihor Radchenko
William Denton  writes:

>> Does it also help if you run M-: (org-fold-core--clear-isearch-overlays)?
>
> That worked!  I just had the problem.  I ran that, and the tree popped open!

Do you use evil-mode?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-10 Thread William Denton

On 10 May 2023, Ihor Radchenko wrote:


"Fraga, Eric"  writes:


And if it helps further, I have had this problem for some time now.  The
solution, for me, is to search for some text I know is present in the
folded section and it unfolds!  But the situation is sporadic and I
cannot reproduce it at will.


Does it also help if you run M-: (org-fold-core--clear-isearch-overlays)?


That worked!  I just had the problem.  I ran that, and the tree popped open!


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.17 ppm (Mauna Loa Observatory, 2023-05-09)

Re: BUG: org-cycle does not unfold some subtrees

2023-05-10 Thread Fraga, Eric
On Wednesday, 10 May 2023 at 08:19, Ihor Radchenko wrote:
> "Fraga, Eric"  writes:
>
>> And if it helps further, I have had this problem for some time now.  The
>> solution, for me, is to search for some text I know is present in the
>> folded section and it unfolds!  But the situation is sporadic and I
>> cannot reproduce it at will.
>
> Does it also help if you run M-: (org-fold-core--clear-isearch-overlays)?

I'll try to remember to try that next time the non-unfolding occurs.  I
should have added that I typically use evil-mode for org files, noting
that others have talked about spacemacs.

-- 
: Eric S Fraga, with org release_9.6.5-353-ge58bbd in Emacs 30.0.50


Re: BUG: org-cycle does not unfold some subtrees

2023-05-10 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> And if it helps further, I have had this problem for some time now.  The
> solution, for me, is to search for some text I know is present in the
> folded section and it unfolds!  But the situation is sporadic and I
> cannot reproduce it at will.

Does it also help if you run M-: (org-fold-core--clear-isearch-overlays)?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-10 Thread Fraga, Eric
On Saturday,  6 May 2023 at 07:46, Thomas S. Dye wrote:
> If it helps, I get this bug using the Spacemacs Org mode layer and
> Emacs 27.

And if it helps further, I have had this problem for some time now.  The
solution, for me, is to search for some text I know is present in the
folded section and it unfolds!  But the situation is sporadic and I
cannot reproduce it at will.

-- 
: Eric S Fraga, with org release_9.6.5-353-ge58bbd in Emacs 30.0.50


Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread William Denton

On 8 May 2023, Thomas S. Dye wrote:

Would it be useful for me to search for calls to the folding functions from 
outline.el in the source code of the Org packages that Spacemacs and I load?


This problems happens to me regularly, and I don't use Spacemacs.  Wherever it 
is, I don't think it's in there.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.26 ppm (Mauna Loa Observatory, 2023-05-08)

Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

>> Which likely means that something is calling folding functions 
>> from
>> outline.el instead of Org-native folding.
>
> Excellent!
>
> Would it be useful for me to search for calls to the folding 
> functions from outline.el in the source code of the Org packages 
> that Spacemacs and I load?

I have another thought now.
Do you happen to use built-in Spacemacs' search module?
If so, what if you switch it do isearch?
See https://github.com/emacs-evil/evil/issues/1630

You can also try running
(org-fold-core-set-folding-spec-property 'org-fold-outline :isearch-open nil)
to see if the problem stops happening.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Michael Dauer
Just another check on my side for any appearance of "org-fold-": Nothing in
my code, only org related packages use it.

$ grep -r -l org-fold- .
./org/.git/index
./org/doc/org-manual.org
./org/etc/ORG-NEWS
./org/lisp/ob-core.el
./org/lisp/ob-exp.el
./org/lisp/ob-lilypond.el
./org/lisp/ob-ref.el
./org/lisp/ol.el
./org/lisp/org-agenda.el
./org/lisp/org-archive.el
./org/lisp/org-capture.el
./org/lisp/org-clock.el
./org/lisp/org-colview.el
./org/lisp/org-compat.el
./org/lisp/org-crypt.el
./org/lisp/org-cycle.el
./org/lisp/org-element.el
./org/lisp/org-feed.el
./org/lisp/org-fold-core.el
./org/lisp/org-fold.el
./org/lisp/org-footnote.el
./org/lisp/org-goto.el
./org/lisp/org-id.el
./org/lisp/org-inlinetask.el
./org/lisp/org-keys.el
./org/lisp/org-lint.el
./org/lisp/org-list.el
./org/lisp/org-loaddefs.el
./org/lisp/org-loaddefs.el~
./org/lisp/org-macs.el
./org/lisp/org-mobile.el
./org/lisp/org-mouse.el
./org/lisp/org-refile.el
./org/lisp/org-src.el
./org/lisp/org-table.el
./org/lisp/org.el
./org/lisp/ox-org.el
./org/lisp/ox.el
./org/testing/lisp/test-org-fold.el
./org/testing/lisp/test-org-list.el
./org/testing/lisp/test-org.el


Am Di., 9. Mai 2023 um 09:58 Uhr schrieb Thomas S. Dye :

>
> Ihor Radchenko  writes:
>
> > "Thomas S. Dye"  writes:
> >
> >>> You can try
> >>> M-x debug-on-variable-change  org-fold-core-style 
> >>
> >> In case it's helpful, I set debug-on-variable-change as you
> >> suggested but was bitten by the bug without triggering the
> >> debugger.
> >
> > Which likely means that something is calling folding functions
> > from
> > outline.el instead of Org-native folding.
>
> Excellent!
>
> Would it be useful for me to search for calls to the folding
> functions from outline.el in the source code of the Org packages
> that Spacemacs and I load?
>
> If so, tips on how to do this efficiently are welcome.
>
> All the best,
> Tom
>
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Thomas S. Dye



Ihor Radchenko  writes:


"Thomas S. Dye"  writes:


You can try
M-x debug-on-variable-change  org-fold-core-style 


In case it's helpful, I set debug-on-variable-change as you 
suggested but was bitten by the bug without triggering the 
debugger.


Which likely means that something is calling folding functions 
from

outline.el instead of Org-native folding.


Excellent!

Would it be useful for me to search for calls to the folding 
functions from outline.el in the source code of the Org packages 
that Spacemacs and I load?


If so, tips on how to do this efficiently are welcome.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: BUG: org-cycle does not unfold some subtrees

2023-05-09 Thread Ihor Radchenko
Michael Dauer  writes:

> What could be called. It's not org-fold-core-style.

I am not really sure.
In order to avoid these situations Org advices `outline-flag-region'.
But something may apply outline overlays bypassing that function, in theory.

> Can I be just a data corruption of the text properties? I've no idea what
> they are exactly, and what other parts use them. Maybe a conflicting key,
> or failed optimization, or side effect on the regions they apply to. I just
> want to give ideas from somebody who is free of knowledge.

If your `org-fold-core-style' is set to 'text-properties (default),
folding in Org should never ever use overlays that were observed in this
thread.

> My guess is that the issue is within org-mode. But tell us, what functions
> we should look for in our code and the used packages.

I am 99% sure it is not within Org.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-08 Thread Michael Dauer
What could be called. It's not org-fold-core-style.

Can I be just a data corruption of the text properties? I've no idea what
they are exactly, and what other parts use them. Maybe a conflicting key,
or failed optimization, or side effect on the regions they apply to. I just
want to give ideas from somebody who is free of knowledge.

My guess is that the issue is within org-mode. But tell us, what functions
we should look for in our code and the used packages.

Am Di., 9. Mai 2023 um 08:23 Uhr schrieb Ihor Radchenko :

> "Thomas S. Dye"  writes:
>
> >> You can try
> >> M-x debug-on-variable-change  org-fold-core-style 
> >
> > In case it's helpful, I set debug-on-variable-change as you
> > suggested but was bitten by the bug without triggering the
> > debugger.
>
> Which likely means that something is calling folding functions from
> outline.el instead of Org-native folding.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-08 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

>> You can try
>> M-x debug-on-variable-change  org-fold-core-style 
>
> In case it's helpful, I set debug-on-variable-change as you 
> suggested but was bitten by the bug without triggering the 
> debugger.

Which likely means that something is calling folding functions from
outline.el instead of Org-native folding.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-08 Thread Thomas S. Dye

Ihor Radchenko  writes:


"Thomas S. Dye"  writes:


For me, the bug bites intermittently.  I often run an Emacs
instance for more than a week before I'm bitten, so it will 
likely

be a long process to work through the packages loaded on top of
what Spacemacs loads to make a reproducer.


Others in this thread appear to be affected more frequently. So, 
you may

get lucky just by following the thread.

Also, I anticipate a problem deciding that removing a package 
has
squashed the bug; will two weeks without the bug be long 
enough?

Three?  Four or more?


You can try
M-x debug-on-variable-change  org-fold-core-style 


In case it's helpful, I set debug-on-variable-change as you 
suggested but was bitten by the bug without triggering the 
debugger.


I was alerted to the bug bite when I noticed some folded content 
after the ellipsis on two headlines, both of which folded and 
unfolded without issue (modulo the content after the ellipsis). 
In both cases, the content after the ellipsis consisted of links 
from an Org table, and just those links.  When I fold the parent 
of a misbehaving headline, the links follow the fold and show up 
after the ellipsis of the parent.  The headline that would not 
unfold did not have content after the ellipsis.


I have some ideas about what might have triggered the problem with 
links after ellipses and will check systematically when I find 
time.


Let me know if you have questions.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Thomas S. Dye



Ihor Radchenko  writes:


"Thomas S. Dye"  writes:

For me, the bug bites intermittently.  I often run an Emacs 
instance for more than a week before I'm bitten, so it will 
likely 
be a long process to work through the packages loaded on top of 
what Spacemacs loads to make a reproducer.


Others in this thread appear to be affected more frequently. So, 
you may

get lucky just by following the thread.

Also, I anticipate a problem deciding that removing a package 
has 
squashed the bug; will two weeks without the bug be long 
enough? 
Three?  Four or more?


You can try
M-x debug-on-variable-change  org-fold-core-style 


Done.  Thanks.

All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

> For me, the bug bites intermittently.  I often run an Emacs 
> instance for more than a week before I'm bitten, so it will likely 
> be a long process to work through the packages loaded on top of 
> what Spacemacs loads to make a reproducer.

Others in this thread appear to be affected more frequently. So, you may
get lucky just by following the thread.

> Also, I anticipate a problem deciding that removing a package has 
> squashed the bug; will two weeks without the bug be long enough? 
> Three?  Four or more?

You can try
M-x debug-on-variable-change  org-fold-core-style 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Thomas S. Dye



Ihor Radchenko  writes:


"Thomas S. Dye"  writes:


But some third-party package might be.
May you try disabling various extra packages and see if the 
problem persists?


If it helps, I get this bug using the Spacemacs Org mode layer 
and 
Emacs 27.


Sorry, but it does not help.
Without reproducer, I can only guess.

And I do not see any bug reports in Spacemacs repo. So, you 
likely has

something else contributing.


OK, that helps.

For me, the bug bites intermittently.  I often run an Emacs 
instance for more than a week before I'm bitten, so it will likely 
be a long process to work through the packages loaded on top of 
what Spacemacs loads to make a reproducer.


Also, I anticipate a problem deciding that removing a package has 
squashed the bug; will two weeks without the bug be long enough? 
Three?  Four or more?


I've found that I can work around the bug by moving the headline 
up or down.  Once this is done, the headline unfolds.  Then, when 
I move it back to its original position, it still unfolds 
properly.  For me, this is easier than my first workaround, which 
involved stopping and re-starting the Emacs instance.


Possibly related, I intermittently get bits of text following the 
ellipsis that indicates a folded headline.  My impression is that 
this happens when the bug has bitten a folded headline, but if I 
remember correctly, the bug and the bits of text following the 
ellipsis are not on the same heading.  I'll check systematically 
next time I see this, if you think it might help.


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Ihor Radchenko
"Thomas S. Dye"  writes:

>> But some third-party package might be.
>> May you try disabling various extra packages and see if the 
>> problem persists?
>
> If it helps, I get this bug using the Spacemacs Org mode layer and 
> Emacs 27.

Sorry, but it does not help.
Without reproducer, I can only guess.

And I do not see any bug reports in Spacemacs repo. So, you likely has
something else contributing.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Thomas S. Dye



Ihor Radchenko  writes:


Michael Dauer  writes:

I'm not doing anything with org-fold-core-style directly. The 
only maybe

relevant thing I do after (org-mode) is:
(straight-use-package 'org-modern)


I do not think that org-modern can be a culprit.
But some third-party package might be.
May you try disabling various extra packages and see if the 
problem persists?


If it helps, I get this bug using the Spacemacs Org mode layer and 
Emacs 27.


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Christopher M. Miles

I got similar result:


#+begin_example
Text content at position 33755:


There is an overlay here:
 From 33755 to 36387
  evaporatet
  invisibleorg-fold-outline
  isearch-open-invisible delete-overlay
  org-invisibleorg-fold-outline
  priority 5


There are text properties here:
  face org-level-2
  fontifiedt
  isearch-open-invisible org-fold-core--isearch-show
  isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
  jinx--pendingt

#+end_example

#+begin_example
Text content at position 36387:


There are text properties here:
  fontifiedt
  isearch-open-invisible org-fold-core--isearch-show
  isearch-open-invisible-temporary org-fold-core--isearch-show-temporary

#+end_example

I confirmed I have NOT set `org-fold-core-style` to 'overlay.

Seems I have same reason with Michael.

Michael Dauer  writes:

> Got another observation:
> Text content at position 30248:
>
> There is an overlay here:
>  From 30248 to 30442
>   evaporatet
>   invisibleorg-fold-outline
>   isearch-open-invisible delete-overlay
>   org-invisibleorg-fold-outline
>   priority 5
>
> There are text properties here:
>   fontifiedt
>   isearch-open-invisible org-fold-core--isearch-show
>   isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
>
> Am Sa., 6. Mai 2023 um 08:24 Uhr schrieb Ihor Radchenko :
>
>  "Christopher M. Miles"  writes:
>
>  > I meet an unfold-able headline now. Then I record a video to show this
>  > unfold-able headline. I executed command "describe-text-properties".
>
>  Please put the cursor right before the fold ("..."), execute M-x
>  describe-text-properties and share the properties description text.
>  You don't need video to share the property details buffer contents.
>
>  -- 
>  Ihor Radchenko // yantar92,
>  Org mode contributor,
>  Learn more about Org mode at .
>  Support Org development at ,
>  or support my work at 


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Ihor Radchenko
Michael Dauer  writes:

> I'm not doing anything with org-fold-core-style directly. The only maybe
> relevant thing I do after (org-mode) is:
> (straight-use-package 'org-modern)

I do not think that org-modern can be a culprit.
But some third-party package might be.
May you try disabling various extra packages and see if the problem persists?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Michael Dauer
I'm not doing anything with org-fold-core-style directly. The only maybe
relevant thing I do after (org-mode) is:
(straight-use-package 'org-modern)
(global-org-modern-mode)
(setq org-pretty-entities t)
(setq org-pretty-entities-include-sub-superscripts nil)
(setq org-ellipsis "…")
(setq org-modern-hide-stars nil) ; somehow fixes indentation of body

And I think that I can only do it after loading org-mode.

Am Sa., 6. Mai 2023 um 09:36 Uhr schrieb Ihor Radchenko :

> Michael Dauer  writes:
>
> > This sibling branch works:
> > Text content at position 27007:
> >
> >
> > There are text properties here:
> >   fontifiedt
> >   isearch-open-invisible org-fold-core--isearch-show
> >   isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
> >   org-fold--spec-org-fold-outline-1035805047878762682 org-fold-outline
>
> If you have both Org fold overlay and text properties at the same time,
> you are doing something funny with `org-fold-core-style'. If you do set
> it, please only do it before Org is loaded.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Ihor Radchenko
Michael Dauer  writes:

> This sibling branch works:
> Text content at position 27007:
>
>
> There are text properties here:
>   fontifiedt
>   isearch-open-invisible org-fold-core--isearch-show
>   isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
>   org-fold--spec-org-fold-outline-1035805047878762682 org-fold-outline

If you have both Org fold overlay and text properties at the same time,
you are doing something funny with `org-fold-core-style'. If you do set
it, please only do it before Org is loaded.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Michael Dauer
This sibling branch works:
Text content at position 27007:


There are text properties here:
  fontifiedt
  isearch-open-invisible org-fold-core--isearch-show
  isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
  org-fold--spec-org-fold-outline-1035805047878762682 org-fold-outline

Am Sa., 6. Mai 2023 um 09:18 Uhr schrieb Michael Dauer :

> Got another observation:
> Text content at position 30248:
>
>
> There is an overlay here:
>  From 30248 to 30442
>   evaporatet
>   invisibleorg-fold-outline
>   isearch-open-invisible delete-overlay
>   org-invisibleorg-fold-outline
>   priority 5
>
>
> There are text properties here:
>   fontifiedt
>   isearch-open-invisible org-fold-core--isearch-show
>   isearch-open-invisible-temporary org-fold-core--isearch-show-temporary
>
> Am Sa., 6. Mai 2023 um 08:24 Uhr schrieb Ihor Radchenko <
> yanta...@posteo.net>:
>
>> "Christopher M. Miles"  writes:
>>
>> > I meet an unfold-able headline now. Then I record a video to show this
>> > unfold-able headline. I executed command "describe-text-properties".
>>
>> Please put the cursor right before the fold ("..."), execute M-x
>> describe-text-properties and share the properties description text.
>> You don't need video to share the property details buffer contents.
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at .
>> Support Org development at ,
>> or support my work at 
>>
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-06 Thread Michael Dauer
Got another observation:
Text content at position 30248:


There is an overlay here:
 From 30248 to 30442
  evaporatet
  invisibleorg-fold-outline
  isearch-open-invisible delete-overlay
  org-invisibleorg-fold-outline
  priority 5


There are text properties here:
  fontifiedt
  isearch-open-invisible org-fold-core--isearch-show
  isearch-open-invisible-temporary org-fold-core--isearch-show-temporary

Am Sa., 6. Mai 2023 um 08:24 Uhr schrieb Ihor Radchenko :

> "Christopher M. Miles"  writes:
>
> > I meet an unfold-able headline now. Then I record a video to show this
> > unfold-able headline. I executed command "describe-text-properties".
>
> Please put the cursor right before the fold ("..."), execute M-x
> describe-text-properties and share the properties description text.
> You don't need video to share the property details buffer contents.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Christopher M. Miles

"Christopher M. Miles"  writes:

> [[PGP Signed Part:Undecided]]
>
> I meet an unfold-able headline now. Then I record a video to show this
> unfold-able headline. I executed command "describe-text-properties".
> Afterwards, I closed the buffer, then re-open the file to show the
> headline can be expanded normally, and show the subtree content.
>
> Here is the uploaded video (P.S, I know video link is not a good way to
> archive information in mailing list, but this problem seems can't be
> text-described simply. Sorry about this.):
>
> https://upload.disroot.org/r/QNhW1xz0#X2or/2T7i7Kb7pHPxfAupRaEYJ28Sbp+2R6UDREnFic=

I recorded a new video which contains the Edebug process. Which shows
the `org-cycle' function internal status data. Ihor, hope this can help
you find the reason.

https://upload.disroot.org/r/khVnJgYV#vMBC3hiBUoPqBG2bgTEfJb44AUrGXVDuvpVGKv8Vw+w=

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> I meet an unfold-able headline now. Then I record a video to show this
> unfold-able headline. I executed command "describe-text-properties".

Please put the cursor right before the fold ("..."), execute M-x
describe-text-properties and share the properties description text.
You don't need video to share the property details buffer contents.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Christopher M. Miles

I meet an unfold-able headline now. Then I record a video to show this
unfold-able headline. I executed command "describe-text-properties".
Afterwards, I closed the buffer, then re-open the file to show the
headline can be expanded normally, and show the subtree content.

Here is the uploaded video (P.S, I know video link is not a good way to
archive information in mailing list, but this problem seems can't be
text-described simply. Sorry about this.):

https://upload.disroot.org/r/QNhW1xz0#X2or/2T7i7Kb7pHPxfAupRaEYJ28Sbp+2R6UDREnFic=

Ihor Radchenko  writes:

> Michael Dauer  writes:
>
>> This is with the cursor on the first asterisk:
>> Text content at position 299:
>>
>>
>> There are text properties here:
>>   display  [Show]
>>   face org-level-1
>>   fontifiedt
>
> Well. This shows nothing.
> I am more interested in text properties at the fold.
>
>> I could not test more positions because I accidentally cut it, and even an
>> undo fixed it. I would have to wait until it happens again.
>
> Sure. Let me know when you are able to get more info.


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Christopher M. Miles

Michael Dauer  writes:

> Maybe I missed a known bug when doing the research. But all the other reports 
> describe different and
> reproducible behaviour.
>
> Sometimes (often) I cannot unfold a subtree. It then affects only one or more 
> subtrees while others in the
> same buffer or even the same branch still work. The only fix then is to 
> either cut and paste the affected
> branches, or to close and reopen the file.
>
> While quite frequent I have not achieved to reproduce the issue. It just 
> happens after a while of using
> multiple files navigating with search, tab from agenda, org-refile, and cycle.
>
> Based on my analyses it's not the cycle functions, but must come from broken 
> text attributes. Even
> (org-fold-core-region (point-min) (point-max) nil) does not unfold the 
> affected subtrees then. Assuming
> that (org-fold-core-region) is the only place where the folding and hiding 
> happens, I expect the problem
> there. But I understand too little about the emacs internals to debug this 
> function.
>
> I hope this helps to fix the issue.
>
> Org mode version 9.7-pre (release_9.6.4-327-gf81ba4

I got same problem many times. Usually I close buffer and re-open file again.
I can confirm this issue. I will provides some info help here too.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Ihor Radchenko
Michael Dauer  writes:

> This is with the cursor on the first asterisk:
> Text content at position 299:
>
>
> There are text properties here:
>   display  [Show]
>   face org-level-1
>   fontifiedt

Well. This shows nothing.
I am more interested in text properties at the fold.

> I could not test more positions because I accidentally cut it, and even an
> undo fixed it. I would have to wait until it happens again.

Sure. Let me know when you are able to get more info.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Michael Dauer
This is with the cursor on the first asterisk:
Text content at position 299:


There are text properties here:
  display  [Show]
  face org-level-1
  fontifiedt

I could not test more positions because I accidentally cut it, and even an
undo fixed it. I would have to wait until it happens again.

Am Fr., 5. Mai 2023 um 19:43 Uhr schrieb Ihor Radchenko :

> Michael Dauer  writes:
>
> > Based on my analyses it's not the cycle functions, but must come from
> > broken text attributes. Even (org-fold-core-region (point-min)
> (point-max)
> > nil) does not unfold the affected subtrees then. Assuming that
> > (org-fold-core-region) is the only place where the folding and
> > hiding happens, I expect the problem there. But I understand too little
> > about the emacs internals to debug this function.
>
> May you please put a point right before the problematic fold, run
> M-x describe-text-properties , and share the contents of the newly
> displayed buffer listing all the text properties?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: BUG: org-cycle does not unfold some subtrees

2023-05-05 Thread Ihor Radchenko
Michael Dauer  writes:

> Based on my analyses it's not the cycle functions, but must come from
> broken text attributes. Even (org-fold-core-region (point-min) (point-max)
> nil) does not unfold the affected subtrees then. Assuming that
> (org-fold-core-region) is the only place where the folding and
> hiding happens, I expect the problem there. But I understand too little
> about the emacs internals to debug this function.

May you please put a point right before the problematic fold, run
M-x describe-text-properties , and share the contents of the newly
displayed buffer listing all the text properties?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at