forked from mirrors/org-mode
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).
This commit is contained in:
parent
ccd1d1a198
commit
250abf061b
12
lisp/org.el
12
lisp/org.el
|
@ -7542,7 +7542,7 @@ This is important for non-interactive uses of the command."
|
||||||
(let ((itemp (org-in-item-p))
|
(let ((itemp (org-in-item-p))
|
||||||
(may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
|
(may-split (org-get-alist-option org-M-RET-may-split-line 'headline))
|
||||||
(respect-content (or org-insert-heading-respect-content
|
(respect-content (or org-insert-heading-respect-content
|
||||||
(equal arg '(16))))
|
(equal arg '(4))))
|
||||||
(initial-content "")
|
(initial-content "")
|
||||||
(adjust-empty-lines t))
|
(adjust-empty-lines t))
|
||||||
|
|
||||||
|
@ -7565,6 +7565,10 @@ This is important for non-interactive uses of the command."
|
||||||
(org-insert-item))
|
(org-insert-item))
|
||||||
|
|
||||||
(t
|
(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
|
;; Insert a heading
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(widen)
|
(widen)
|
||||||
|
@ -7759,8 +7763,8 @@ This is a list with the following elements:
|
||||||
(defun org-insert-todo-heading (arg &optional force-heading)
|
(defun org-insert-todo-heading (arg &optional force-heading)
|
||||||
"Insert a new heading with the same level and TODO state as current 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
|
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
|
state (TODO by default). Also with one prefix arg, force first state. With
|
||||||
prefix args, force inserting at the end of the parent subtree."
|
two prefix args, force inserting at the end of the parent subtree."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(when (or force-heading (not (org-insert-item 'checkbox)))
|
(when (or force-heading (not (org-insert-item 'checkbox)))
|
||||||
(org-insert-heading (or (and (equal arg '(16)) '(16))
|
(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))
|
(looking-at org-todo-line-regexp))
|
||||||
(let*
|
(let*
|
||||||
((new-mark-x
|
((new-mark-x
|
||||||
(if (or arg
|
(if (or (equal arg '(4))
|
||||||
(not (match-beginning 2))
|
(not (match-beginning 2))
|
||||||
(member (match-string 2) org-done-keywords))
|
(member (match-string 2) org-done-keywords))
|
||||||
(car org-todo-keywords-1)
|
(car org-todo-keywords-1)
|
||||||
|
|
Loading…
Reference in New Issue