abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.27k stars 337 forks source link

swiper-isearch in org-mode breaks org-cycle #3015

Open jamieforth opened 1 year ago

jamieforth commented 1 year ago

Maybe relates to #2457.

Using make plain (b8be4913) with the build-in Org 9.3 everything works fine.

But make plain with Org 9.6.1 installed causes the following problems.

Test case 1:

  1. use the following content for org file, fold all items
    * HEADING 1
    ** test1
    * HEADING 2
    ** test2
    * HEADING 3
    ** test3
  2. swiper-isearch for "test" - HEADING 1 unfolds correctly
  3. C-g - HEADING 1 folds correctly
  4. org-cycle - HEADING 1 can no longer be unfolded

Test case 2:

  1. use the same file content as above
  2. swiper-isearch for "test1" - HEADING 1 folds incorrectly
  3. ENTER - HEADING 1 unfolds correctly
  4. org-cycle works

Test case 3:

  1. use the same file content as above
  2. swiper-isearch for "test1" - HEADING 1 folds incorrectly
  3. C-g - HEADING 1 stays folded correctly
  4. org-cycle - HEADING 1 can no longer be unfolded

Environment: Debian 11, Emacs 27.1.

slk500 commented 1 year ago

I also have this issue. But it's not so easy to reproduce. Just after using swiper in buffer, I can't unfold some headings. GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-02-26 Org mode version 9.6.1 (release_9.6.1-34-geea8da)

jamieforth commented 1 year ago

I see the same problem with Org mode version 9.6.4 (reliably reproducible).

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2023-02-23, modified by Debian

ahktenzero commented 1 year ago

Same issue here, also I have display problems after searching with Swiper where a headline will fold but certain links in the contents don't get hidden when the parent headline is collapsed.

Org 9.6 changed the method for hiding folded text to use text properties instead of overlays. The docstring for org-fold-core-style mentions that using text properties may cause issues with packages which haven't been updated to be compatible with the new system. I tried to reproduce the problem in a clean Emacs with just Org and Swiper loaded and the folding style set to overlays and that seems to fix it.

Org mode version 9.6.4 (9.6.4-ge065b5) GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-03-14, modified by Debian

rwilson4 commented 1 year ago

Hi folks, some recent conversation on the org-mode mailing list may help: https://lists.gnu.org/archive/html/emacs-orgmode/2023-05/msg00258.html

Basically, this code: https://github.com/abo-abo/swiper/blob/master/swiper.el#L980 should call `isearch-mode-end-hook'.

HTH, Bob

basil-conto commented 1 year ago

Hi folks, some recent conversation on the org-mode mailing list may help: https://lists.gnu.org/archive/html/emacs-orgmode/2023-05/msg00258.html

Seems to have been brought up on emacs-devel too:

Basically, this code: https://github.com/abo-abo/swiper/blob/master/swiper.el#L980 should call `isearch-mode-end-hook'.

Would you be interested in proposing a patch?

What about the other three uses of isearch-filter-predicate in swiper.el?

Thanks.

rwilson4 commented 1 year ago

Unfortunately I don't feel confident enough in my elisp to propose a patch! Just thought I'd share the link since I'm affected by this issue as well.

ujikol commented 10 months ago

Any news here?

This issue is also reported on the org-mode side: https://list.orgmode.org/orgmode/875y5oo9nv.fsf@localhost/

Would you please do your testing with the Org dev branch.

uselpa commented 3 months ago

Hello chiming in, because I encounter this a few times a day, and only now realised it's due to a swiper-orgmode conflict. Is there a known workaround, or solution, at this point? Using Emacs 29.2 on macOS, swiper from ELPA. Regards, -Patrick