Browse Source

org.el (org-insert-heading): If the current item has a checkbox, insert the new item with a checkbox

* org.el (org-insert-heading): If the current item has a
checkbox, insert the new item with a checkbox.
Bastien Guerry 12 years ago
parent
commit
834db79fc5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lisp/org.el

+ 6 - 1
lisp/org.el

@@ -7380,7 +7380,12 @@ This is important for non-interactive uses of the command."
 	 (if (org-previous-line-empty-p) "" "\n")
 	 (if (org-in-src-block-p) ",* " "* "))
 	(run-hooks 'org-insert-heading-hook))
-    (when (or arg (not (org-insert-item)))
+    (when (or arg
+	      (not (org-insert-item
+		    (save-excursion
+		      (beginning-of-line)
+		      (looking-at org-list-full-item-re)
+		      (match-string 3)))))
       (let* ((empty-line-p nil)
 	     (eops (equal arg '(16))) ; insert at end of parent subtree
 	     (org-insert-heading-respect-content