From 7d1e644715f5729e49791408a7aabc37b1da6877 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 3 Nov 2008 22:18:25 +0100 Subject: [PATCH] Fix inserting headlines at the end of the buffer. When the cursor is at the end of the buffer but not at the beginning of a line, inserting a new headline with C-RET did insert the stars into the last line, without adding the needed newline. The new line is now added. --- lisp/ChangeLog | 3 +++ lisp/org.el | 1 + 2 files changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a4ae0f8ce..8c9407dec 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-11-03 Carsten Dominik + * org.el (org-insert-heading): If buffer does not end with a + newline, add one if necessary to insert headline correctly. + * org-exp.el (org-export-as-html): Make sure that
is between paragraphs, not inside. diff --git a/lisp/org.el b/lisp/org.el index 6a6f9f402..ed0ef3810 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4648,6 +4648,7 @@ but create the new headline after the current line." (cond (org-insert-heading-respect-content (org-end-of-subtree nil t) + (or (bolp) (newline)) (open-line 1)) ((org-on-heading-p) (when hide-previous