Brett <brett.kerw...@gmail.com> writes: > Create a 3-line file named foobar.org containing exactly this: > > * foo > ** bar > baz > > (So the first character of the file is *.) Type > > emacs -Q foobar.org > > and type > > TAB M-: (isearch-forward) RET b RET > > (this folds everything, then calls the isearch-forward function, searches > for b which will unfold everything and position the point on the second > line). Now type TAB: this should fold the second heading only, but it will > fold everything. And in fact you can try moving around and pressing TAB > again as many times as you want: you will never be able to fold only the > second heading again.
Thanks for reporting! Fixed, on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d1e8023eb > Note that replacing > > M-: (isearch-forward) > > in the above sequence with > > M-x isearch-forward > > does NOT trigger the bug, instead it does produce the desired behaviour. I have to say that doing M-: (isearch-forward) is to be avoided. In such scenario, isearch assumes that it is in the process of recursive edit and does not cleanup overlays. Unless you are really doing recursive editing, this will end up accumulating overlays that do nothing. This is not just for Org. outline-mode will suffer similar problem. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>