5

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?

1 Answer 1

6

This behaviour is controlled by the variable org-blank-before-new-entry. This variable contains a list of two elements, one for heading and one for plain-list-item. The default value for each element 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 the element values to nil instead, new lines will never be inserted:

(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 and acknowledge you have read our privacy policy.

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