summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-03-12 17:51:18 +0100
committerBastien Guerry <bzg@altern.org>2014-03-12 17:51:18 +0100
commit250abf061ba81c1d010c19d5f54506f10a37c1cb (patch)
treea1ebabc992e575e76ec728280367d29961e189f3
parentccd1d1a19889fda0fd5c783fedb3e42ef1963701 (diff)
downloadorg-mode-250abf061ba81c1d010c19d5f54506f10a37c1cb.tar.gz
Bugfixes wrt inserting headings.
* org.el (org-insert-heading): Fix regression: with two universal prefixes, insert heading at the end of the subtree. (org-insert-todo-heading): Bugfix: only enforce the first TODO state when arg is '(4).
-rw-r--r--lisp/org.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 0e36f60..720600d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7542,7 +7542,7 @@ This is important for non-interactive uses of the command."
(let ((itemp (org-in-item-p))
(may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
(respect-content (or org-insert-heading-respect-content
- (equal arg '(16))))
+ (equal arg '(4))))
(initial-content "")
(adjust-empty-lines t))
@@ -7565,6 +7565,10 @@ This is important for non-interactive uses of the command."
(org-insert-item))
(t
+ ;; Maybe move at the end of the subtree
+ (when (equal arg '(16))
+ (org-up-heading-safe)
+ (org-end-of-subtree t))
;; Insert a heading
(save-restriction
(widen)
@@ -7759,8 +7763,8 @@ This is a list with the following elements:
(defun org-insert-todo-heading (arg &optional force-heading)
"Insert a new heading with the same level and TODO state as current heading.
If the heading has no TODO state, or if the state is DONE, use the first
-state (TODO by default). Also one prefix arg, force first state. With two
-prefix args, force inserting at the end of the parent subtree."
+state (TODO by default). Also with one prefix arg, force first state. With
+two prefix args, force inserting at the end of the parent subtree."
(interactive "P")
(when (or force-heading (not (org-insert-item 'checkbox)))
(org-insert-heading (or (and (equal arg '(16)) '(16))
@@ -7771,7 +7775,7 @@ prefix args, force inserting at the end of the parent subtree."
(looking-at org-todo-line-regexp))
(let*
((new-mark-x
- (if (or arg
+ (if (or (equal arg '(4))
(not (match-beginning 2))
(member (match-string 2) org-done-keywords))
(car org-todo-keywords-1)