1

In the following text:

foo

- s
  - sdljk

with point at the end of the block, pressing M-<RET> will alter the buffer to then look like this:

foo

- s
  - sdljk

  - 

Same situation, but with original buffer as

foo
- s
  - sdljk

M-<RET> will alter the buffer to become:

foo
- s
  - sdljk
  - 

I have two questions:

  1. What controls this behavior? What determines whether a newline is inserted or not? I cannot find documentation on this (C-h k M-<RET>, as well as a basic search of the Org manual yielded nothing).
  2. How can I change it so that a newline is never inserted?
2

This behaviour is controlled by the variable org-blank-befrore-new-entry. This variable contains a list with two elements, one for heading and one for plain-list-item. The default value is 'auto, which means Emacs will try to decide based on context if it should insert a new line when adding a list item or heading. If you set it to nil instead, it will never insert the new line:

(setq org-blank-before-new-entry (quote ((heading . nil)
                                         (plain-list-item . nil))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.