14

Disclaimer: I am new to org-mode.

In org-mode, I sometimes add extra empty lines to make the separation between different tasks clearer when they are expanded. Like so:

** Task 1

*** Subtask 1.1
    text text
*** Subtask 1.2

** Task 2

The problem is that when I fold 'Task 1' (by pressing C-tab while on its line) the subtasks and their contents are folded correctly, but the content of 'Subtask 1.2' is also folded (namely, the new line under it).

If I press C-tab while on the line of 'Subtask 1.2', the message 'SUBTREE (NO CHILDREN)' is printed and 'Subtask 1.2' is correctly not folded.

Is this normal? Can I somehow correct this behaviour so that empty content is not folded?

Tohiko
  • 1,860
  • 2
  • 18
  • 26
  • 1
    Does customizing the variable `org-cycle-separator-lines` help any? http://orgmode.org/manual/Headlines.html To learn more about all the possible customizations for said variable, type `M-x describe-variable RET org-cycle-separator-lines RET` To know whether any behavior in Emacs is normal, start with `emacs -q` and see how it behaves by default with no user-configuration. – lawlist Oct 30 '16 at 19:07
  • See also the variable `outline-blank-line`: "*Non-nil means to leave unhidden blank line before heading.*" This will affect commands such as `org-content`. – lawlist Oct 30 '16 at 19:23
  • Thanks. I tried different combinations of these settings using `setq` (and including negative values for `org-cycle-separator-lines`) but that did not change the folding behaviour. – Tohiko Oct 31 '16 at 07:42

1 Answers1

14

Use (setq org-cycle-separator-lines -1) in your config file. This will fix it.

Documentation:
Number of empty lines needed to keep an empty line between collapsed trees.
If you leave an empty line between the end of a subtree and the following
headline, this empty line is hidden when the subtree is folded.
Org mode will leave (exactly) one empty line visible if the number of
empty lines is equal or larger to the number given in this variable.
So the default 2 means at least 2 empty lines after the end of a subtree
are needed to produce free space between a collapsed subtree and the
following headline.

If the number is negative, and the number of empty lines is at least -N,
all empty lines are shown.
jue
  • 435
  • 5
  • 7