Explorar el Código

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.
Carsten Dominik hace 17 años
padre
commit
7d1e644715
Se han modificado 2 ficheros con 4 adiciones y 0 borrados
  1. 3 0
      lisp/ChangeLog
  2. 1 0
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2008-11-03  Carsten Dominik  <dominik@science.uva.nl>
 
+	* 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 <hr/> is between
 	paragraphs, not inside.
 

+ 1 - 0
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