浏览代码

Fix bug with C-RET

Leo writes:

> Hi there,
>
> ,----[ (info "(org)Structure editing") ]
> | `C-<RET>'
> |      Just like `M-<RET>', except when adding a new heading below the
> |      current heading, the new heading is placed after the body instead
> |      of before it.  This command works from anywhere in the entry.
> `----
>
> Inside a substree and with the point at the beginning of a line, C-RET
> turns the current line into a heading. In the following example, ><
> indicates where the point is.
>
> ----------------
> * Sample
> <  This is not a heading
> ----------------
>
> After C-RET, it changes to
> ----------------
> * Sample
> * This is not a heading
> ----------------
>
> I can reproduce this with org 6.29c as included in Emacs. Can someone
> else reproduce this bug?
Carsten Dominik 15 年之前
父节点
当前提交
76d970b761
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      lisp/ChangeLog
  2. 1 0
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-08-07  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-insert-heading): When respecting content, do not
+	convert current line to headline.
+
 	* org-clock.el (org-clock-save-markers-for-cut-and-paste): Also
 	cheeeeeck the hd marker
 	(org-clock-in): Also set the hd marker.

+ 1 - 0
lisp/org.el

@@ -5665,6 +5665,7 @@ but create the new headline after the current line."
 	  ;; insert before the current line
 	  (open-line (if blank 2 1)))
 	 ((and (bolp)
+	       (not org-insert-heading-respect-content)
 	       (or (bobp)
 		   (save-excursion
 		     (backward-char 1) (not (org-invisible-p)))))