Kévin Le Gouguec <kevin.legoug...@gmail.com> writes: > I can't find any reference to this property in Org <9.4 (e.g. 9.3 as > shipped in 27.1, where the bug does not happen) so do I understand > correctly that the root cause ("since [drawers] are in the same overlay > with the rest of the folded heading") dates from Org 9.4?
Yes, the root cause is that overlays used to hide drawers now automatically merge with outline overlays. This was introduced in Org 9.4 to improve performance (too many overlays are handled badly by Emacs). > (Just trying to understand if I should keep looking at Org 9.3 for > inspiration, or if your proposed solution based on > isearch-open-invisible-temporary should be implemented from scratch) You will probably need to implement this from scratch (or use the feature/org-fold branch from github.com/yantar92/org). In Org 9.3 the folded headline looked like the following: * Headline <begin hidden outline overlay> :PROPERTIES:<begin hidden drawer overlay> :PROPERTY1: value1 :PROPERTY2: value2 :END:<end hidden drawer overlay> headline text another line <end hidden outline overlay> When using isearch with "text" search string, the overlay containing "text" is temporarily revealed by isearch (via setting 'invisible property of the overlay to nil): * Headline <begin *visible* outline overlay> :PROPERTES:<begin hidden drawer overlay> :PROPERTY1: value1 :PROPERTY2: value2 :END:<end hidden drawer overlay> headline text another line <end *visible* outline overlay> As you can see, the drawer overlay remains unchanged and hidden. In Org 9.4, drawer overlay does not exist when we fold the headline text and isearch reveals everything. To work around this issue, you need to hook into the way isearch reveals hidden match by setting 'isearch-open-invisible-temporary property of the overlays to custom function (you can set the property inside org-flag-region). The function should re-hide the drawers when matching text is not inside the drawer. Best, Ihor