Hi Ihor, On Thu, Nov 18, 2021 at 7:28 AM Ihor Radchenko <yanta...@gmail.com> wrote: > > Carlos Pita <carlosjosepi...@gmail.com> writes: > > > I see no reason why a match inside b2 will hide b1 and b3 but not a > > and c (I'm referring to the headings, not the contents). > > I think you misread the docstring for org-show-context-detail:
Sorry, I don't concur here. This is in the docstring I'm interested in (org-occur): The tree will show the lines where the regexp matches, and any other context defined in ‘org-show-context-detail’, which see. It might be that org-show-context-detail is used for org-reveal, but this says it's also used for org-occur, which makes sense. Besides, there is occur-tree when using the command ‘org-occur’ (‘C-c / /’) as a context for org-show-context-detail and it indeed makes a difference in what is shown and what is hidden. > This variable does not control how much text is hidden, but rather how > much context is revealed around a folded text. > Your misunderstanding may come from the fact that you are interested in > org-occur, which first folds everything inside lowest-level headings. It's not very relevant to my concern if things are first hidden and then revealed, because that will just change my question to why top-levels are not hidden to begin with. Again: The tree will show the lines where the regexp matches, and any other context defined in ‘org-show-context-detail’, which see. The top-level headings in my example don't match the regexp and are not part of the context that org-show-context-detail should reveal with my current configuration. I cannot help concluding that this fact contradicts the documentation. Moreover, even if a escape clause were found in the documentation, the examples I've presented show a behavior that is clearly different for the top-level compared to any other level and that alone calls for some kind of explanation IMO, as it is now it seems arbitrary, perhaps there is an obvious reason for this that I'm failing to grasp. > Consider agenda views. The relevant default value in I indeed considered the agenda, but I prefer using a sparse tree. I have a file with a large number of brief notes in top level headings and it's useful to see the expanded matching notes, the behaviour of org-occur is ideal in this regard, instead the agenda only shows the headings and even in follow mode it's more cumbersome than merely pressing M-g n/p directly in the target buffer. The problem I have now is that hundreds of unmatching headings are still shown just because they happen to be at the top-level. I see I could demote them or just use the agenda, it's no big deal after all. But because of all the reasons above I judge that the current behavior is not right, that's the reason for my report. Nevertheless, thank you for your suggestions, as always. Best regards, Carlos