Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-27 Thread Ihor Radchenko
Tom Gillespie  writes:

> I think we might want to update the documentation to mention
> issue with evil for now

We can, but it will only be required if evil devs don't fix the issue in
a reasonable time frame.

Best,
Ihor



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-27 Thread Ihor Radchenko
Tom Gillespie  writes:

>> Note that if evil were to comply with the canonical isearch
>> implementation and respect isearch-mode-end-hook, there would be no
>> issue.
>
> I think we might want to update the documentation to mention
> issue with evil for now, and alert the evil devs about this change.
> Then we can approach them about implementing support for
> searching inside invisible regions marked via text properties
> since that is essentially a new feature that is being added to
> org for 9.6, though one that will be on by default. 

Feel free to open an issue in evil repo. I do not use evil, so I will
not be able to test any fixes there.

> The evil-search
> module doesn't seem to support _any_ of the isearch hooks needed
> but while looking into this I think I know generally where it might be
> possible to add them.

Not exactly. Evil does support `isearch-filter-predicate', but not
`isearch-mode-end-hook' and `isearch-mode-hook'.

Basically, Org needs evil to support settings listed in
`org-fold-core--isearch-setup'.

Best,
Ihor



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-27 Thread Tom Gillespie
The workaround from the other thread to
(setq org-fold-core-style 'overlays) is perfect.

> The whole point of the patch is _not_ using overlays. For performance
> reasons.

Yep,  the workaround is sufficient for now, and the note on
performance for large files in the docstring makes it clear
what the tradeoffs are, and why we want the text properties
to be the default. Not need to "restore" the old behavior since
it is just a setq away.

> Note that if evil were to comply with the canonical isearch
> implementation and respect isearch-mode-end-hook, there would be no
> issue.

I think we might want to update the documentation to mention
issue with evil for now, and alert the evil devs about this change.
Then we can approach them about implementing support for
searching inside invisible regions marked via text properties
since that is essentially a new feature that is being added to
org for 9.6, though one that will be on by default. The evil-search
module doesn't seem to support _any_ of the isearch hooks needed
but while looking into this I think I know generally where it might be
possible to add them.

Thanks!
Tom



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-27 Thread Ihor Radchenko
Tom Gillespie  writes:

> Might restoring the invisible overlay text property restore
> the old behavior? Is there a reason it was removed?

The whole point of the patch is _not_ using overlays. For performance
reasons.

You can, however, switch to the old behavior by setting
org-fold-core-style to 'overlays. At the cost of some new features being
disabled.

Note that if evil were to comply with the canonical isearch
implementation and respect isearch-mode-end-hook, there would be no
issue.

Best,
Ihor



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-27 Thread Tom Gillespie
> It appears to respect isearch-filter-predicate, but not
> isearch-mode-end-hook.

This is true only when isearch is used as the module via
(evil-select-search-module 'evil-search-module 'isearch),
and indeed, when using evil search in that way headings
no longer refold. When using evil-search, things won't
even unfold.

I think that I have tracked the issue down to
evil-ex-find-next in a call to isearch-range-invisible
which returns nil for commits < 67275f4, and t for >=.
When isearch-range-invisible returns nil the invisible
overlay is made visible, when it returns t it stays closed.

Might restoring the invisible overlay text property restore
the old behavior? Is there a reason it was removed?

Best,
Tom



Re: [BUG] 67275f4 broke evil-search Re: [PATCH 10/35] Implement link folding

2022-05-04 Thread Ihor Radchenko
Tom Gillespie  writes:

> It seems that this patch (as commit
> 67275f4664ce00b5263c75398d78816e7dc2ffa6, found using git bisect to
> hunt down the issue) breaks search in evil mode when
> (evil-select-search-module 'evil-search-module 'evil-search) is set.
> The broken behavior is that evil-search no longer searches inside
> folded headings. I had a quick look at the changes but couldn't figure
> out why these changes might cause the issue. Best,

Evil re-implements isearch functionality and it does it only partially.
It appears to respect isearch-filter-predicate, but not
isearch-mode-end-hook.
I expect this to be a bug on evil side.

Meanwhile, you can try to set search-invisible to t. It should help (in
theory).

Best,
Ihor