0

When running emacs as emacs -nw -q and opening an org-file, insertion of headings goes as follows (X represents the cursor):

* Heading 1
* Heading 2


X

When running org-meta-return here, the next headline is inserted at line 3:

* Heading 1
* Heading 2
* X

As you can see, the whitespace was removed.

Is there a variable I can customize to make it such that running org-meta-return results in:

* Heading 1
* Heading 2


* X

I looked through customize-group org and was not able to find a variable that would control this.

  • A small workaround I found was to modify org.el's definition of org-insert-heading and change the following expression: (org-N-empty-lines-before-current (if blank? 1 0)) to (org-N-empty-lines-before-current 3), but I would like to know if there are better ways of doing this (creating a variable or something along those lines). – Ricardo Iglesias Jun 30 at 16:41
  • I cannot reproduce this with current Org mode ( 9.3.7). I checked the history and there is one likely bug fix that went in during 9.1.14 and before 9.2 was released. Check your Org version (M-x org-version RET) and see if it's 9.1.14 or earlier. If so, I would advise you to upgrade. – NickD Jul 1 at 12:38
  • I see that too (version 9.3.7). You may have to change org-N-empty-lines-before-current or maybe ask the Org developers for help. – jagrg Jul 1 at 20:30
  • Also check org-blank-before-new-entry. The auto values seemed to be playing tricks on me, but setting both heading and plain-list-item to t makes them more predictable (and I like the more relaxed spacing). – NickD Jul 4 at 17:01

Your Answer

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

Browse other questions tagged or ask your own question.