8

I often need to see information up to (down to, really) certain level of detail. Is there a way to unfold blocks to a certain level, and hide the rest? For example:

* name
Joe
** home number
111-111-1111
*** hobby
fishing
*** likes
books
** work number
222-222-2222

If third-level and below blocks are rarely used, then I would like to see them folded as such:

* name
Joe
** home number
111-11-1111
*** hobby...
*** likes...
** work number
222-22-2222
user443854
  • 7,096
  • 13
  • 48
  • 63
  • 1
    Perhaps those items that are not often used or wanted to be seen should be listed as PROPERTIES in a DRAWER? – cm2 Mar 22 '12 at 17:15
  • 1
    This is pretty close to what I want. But: (1) it's a bit verbose to use, and (2) it does not follow block hierarchy and behavior (so folding/unfolding up to a certain level cannot be done). Lastly, (3) collapsed drawer shows up simply as :PROPERTIES:. This is not nice, it does not give any indication of what's inside. It does not tell me at a glance that "hobby" is stored there. – user443854 Mar 22 '12 at 20:34
  • blocks and sections are different animals. Here's an answer for **blocks** : https://emacs.stackexchange.com/q/30504/13477 – Flint Sep 13 '18 at 23:25

2 Answers2

12

There's hide-sublevels. The exact number to use for the level you need will typically vary depending on the major mode, tho. I usually use C-1 M-x hide-sublevels (aka C-1 C-c C-q), but for some major modes I use much deeper levels.

Stefan
  • 27,908
  • 4
  • 53
  • 82
  • 1
    hide-sublevels if only marginally useful as it keeps the blocks folded while hiding both lower-level blocks and the higher-level block's contents. By example above, the phone numbers won't be visible after C-3 M-x hide-sublevels. – user443854 Mar 21 '12 at 17:30
3

If you place the cursor at the beginning of the buffer, a simple <TAB> will cycle the visibility of the entire subtree.

Alternatively, calling it with a prefix argument will set the global subtree visibility to the depth specified by the argument (C-u <TAB>). For example; C-u 3 <TAB> would show everything up to the third level of the tree and hide everything below that.

Also see http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling

Colin Cochrane
  • 2,565
  • 1
  • 19
  • 20
  • 1
    I actually did bother to read the manual. This does not work. Can you try the example I gave? Correction: by "does not work" I mean it does not do what I want to do (see my question). – user443854 Mar 22 '12 at 13:54