Q: how do I make source blocks fold automatically when I hide the contents of their entry?
I'd like source code blocks to fold automatically whenever I hide an entry so that they're always out of the way until I specifically want to see them. Out of the box, however, their visibility seems to be independent of their home entry's visibility.
For example, if I have:
* An entry #+begin_src R x <- 1:10 #+end_src Some descriptive text.
I can toggle the visibility of the source block with TAB when point is on the
begin_src line. However, when I hide (fold) the entry and then show (unfold) it again, the source block seems to remember it's prior visibility state: if it was visible/open, it will be visible when I show/unfold the entry, and if it was invisible/closed, it will be invisible/closed when I show/unfold the entry.
I want to fold/hide my source blocks automatically whenever I fold/hide the entry that contains them. How do I do that?
PS I'm just now learning how to use source blocks, so I may be missing an obvious solution. Apologies if so.