1

The default behaviour of :results drawer is that the results of a code block open in a collapsed state, which is perfect.

However, I would like this to be the default behaviour of the #+RESULTS: of code blocks that are generated by :results code.

Is there a way to have the #+RESULTS: of a code block generated by :results code to be in a collapsed state by default, when opening the document? (just like the default behaviour of :results drawer)

4
  • "...the results of a code block open in a collapsed state": not quite sure how you get this, but this does not happen in my case. The results drawer is unfolded until I explicitly fold drawers.
    – NickD
    Jul 26 at 2:57
  • 1
    Do you know about the function org-babel-result-hide-all? You might want to add it as an "after" advice to one of the babel evaluation functions (perhaps org-babel-eval although I haven't checked to make sure). But don't you want to see the results of the evaluation? If not, why evaluate at all?
    – NickD
    Jul 26 at 3:03
  • The results of my code is in a collapsed state because I use '#+STARTUP: content' in most of my org files and when I open a heading the ':results' drawer is actually collapsed. You are right if I open an org file without the '#+STARTUP: content', it's not the case that it's collapsed.
    – Hyperfocus
    Aug 7 at 13:08
  • Thanks a lot for that function, it works perfectly! The reason I want to hide the results is because it makes it easier to navigate the document at times.
    – Hyperfocus
    Aug 7 at 13:12

This site is temporarily in read only mode and not accepting new answers.

Browse other questions tagged .