Emacs orgmode doesn't insert a line between headers?

In emacs org-mode, when I create a new subtitle (org-insert-subheading), sometimes it adds an empty line, sometimes it is not based on some template in the text above.

Can I make emacs never insert a line break?

Ie

* Heading 1 ** Heading 2 #no line breaks. 
+7
emacs line-breaks org-mode
source share
2 answers

I think this is controlled by the variable org-blank-before-new-entry . According to Org documentation:

Should org-insert-heading leave a blank line before the new header / element? The value is alist, with heading and plain-list-item as CAR, and a Boolean flag as CDR. Cdr can also be the `auto 'character, in which case Org will look at the surrounding headers / elements and try to make a reasonable decision about whether to insert an empty line or not.

For simple lists, if org-list-empty-line-terminates-plain-lists set, it is ignored here and an empty line is not inserted to avoid breaking the list structure.

The default value is '((heading . auto) (plain-list-item . auto)) , so usually it will insert a new line before the heading (the auto part in heading ). You can specify Never when setting up the variable, and it will not insert a new line.

+3
source share

This is controlled by the variable org-blank-before-new-entry :

Should `org-insert-heading' leave a blank line before the new header / element?
The value is alist, with `heading' `plain-list-item' as CAR, and a Boolean flag as CDR. Cdr can also be the `auto' character, in which case Org will look at the surrounding headers / elements and try to make a reasonable decision about whether to insert an empty string or not.

In my version of emacs, the default for both elements is auto . To never insert blank lines, set both parameters: nil :

 (setf org-blank-before-new-entry '((heading . nil) (plain-list-item . nil))) 
+4
source share

All Articles