Here is an illustration of the problem:
- First item. Pressing M-RET...
- Another item at the correct position. Now a blank line:
- Next item after blank line. Now press M-RET again...
- .. but now I'm down here!
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityHere is an illustration of the problem:
- First item. Pressing M-RET...
- Another item at the correct position. Now a blank line:
- Next item after blank line. Now press M-RET again...
- .. but now I'm down here!
You can configure that using the org-blank-before-new-entry
variable.
I have set that to '((heading) (plain-list-item))
so that such blank lines are not auto-inserted after M-RET
for headings and list items.
You can also set just the cdr
of the element with plain-list-item
to nil to get exactly what want by doing:
(setcdr (assoc 'plain-list-item org-blank-before-new-entry) nil)
Have a look at C-h v org-blank-before-new-entry
output.
Should
org-insert-heading
leave a blank line before new heading/item? The value is an alist, withheading
andplain-list-item
as CAR, and a boolean flag as CDR. The cdr may also be the symbolauto
, in which case Org will look at the surrounding headings/items and try to make an intelligent decision whether to insert a blank line or not.
It's default value is
'((heading . auto) (plain-list-item . auto))
So what are are seeing is expected.. as you had a blank line before the "- Next item after blank line. Now press M-RET again..." list item, it inserted a blank line before "- .. but now I'm down here!" too.