0

Subtree View:

* Header 1

** Header 2

Children View:

* Header 1

** Header 2

Desired Children View:

* Header 1
** Header 2

Is there a way to treat the blank line between Header 1 and Header 2 semantically as formatting information rather than as a blank line of "empty content"?

More generally, it would be helpful to provide an option that allows blank lines at the beginning and end of a content section located directly under a heading to be suppressed when locally expanding that heading from the folded view (3 dots) to the children view (through a single TAB keystroke), since this is still supposed to be a compacted view of the file, and only show all of these formatting lines when one enters the full subtree view by hitting TAB a second time.

  • I can't replicate the behaviour that you are describing as the current state. Could you please clarify? When I do `* heading 1 [new line x2] ** heading 2` and then fold it, I get `* heading 1...` Is this question specific to cycling of folding when done with `S-TAB`? – Malle Yeno Jul 30 '22 at 17:25
  • I've edited the original question to make it more clear. – StackExchanger Jul 31 '22 at 04:29
  • Thank you for editing your question to be clearer. Could you let me know if my answer regarding `org-cycle-separator-lines` is what you are looking for? It seems like you might be looking to either set the value for the variable to `0` to ignore the content of the empty lines, or `-N` to make empty lines appear in folded view regardless of location. – Malle Yeno Jul 31 '22 at 19:34

1 Answers1

0

You had mentioned that the behaviour you would like to see is similar to how org-cycle-separator-lines works, except that the variable only works at the end of a section (which I presume means that this does not do what you are looking for, since you would like it at the beginning/before a header).

org-cycle-separator-lines actually has a condition that can edit this behaviour that may allow what you are looking for. From the doc page:

org-cycle-separator-lines

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.
[...]
If the number is negative, and the number of empty lines is at least -N,
all empty lines are shown.

So if you customize org-cycle-separator-lines to be for a negative number, you can get separator lines regardless of where they appear. I set this to -1 and I have this behaviour:

Unfolded:

* heading 1


content


** heading 2
content

content

*** heading 3
some content 

** heading 2 2  

Folded:

* heading 1


** heading 2

*** heading 3 

** heading 2 2  

If you want no separator lines, change this value to 0.

Malle Yeno
  • 373
  • 1
  • 3
  • 15
  • `org-cycle-separator-lines` cannot remove a blank line between a heading and the content directly underneath it because apparently org syntax specification considers that blank line as part of the content. I include these blank lines because I want to see them in the fully expanded SUBTREE view, but in the more compact CHILDREN view I would like to be able to suppress any blank lines between the heading and the content directly underneath it just like `org-cycle-separator-lines` is able to do for any blank lines between the end of a content section and the next heading underneath it. – StackExchanger Aug 06 '22 at 21:04
  • Also note that in the edited version of my original question, changing the value of `org-cycle-separator-lines` from `1` to `0` or `-1` has no effect on the desired result, i.e. suppressing the blank lines both at the beginning and at the end of the content section. – StackExchanger Aug 06 '22 at 21:12