From 834db79fc5418c8bc535035fd020d488688a2dd2 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 5 Mar 2013 11:17:05 +0100 Subject: [PATCH] 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. --- lisp/org.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 781e3be29..588821a8e 100644 --- a/lisp/org.el +++ b/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