* org-mobile.el (org-mobile-edit): DTRT when inserting a heading
in an invisible region.
* org.el (org-insert-heading-respect-content): New
`invisible-ok' parameter. Add docstring.
(org-insert-todo-heading-respect-content): Add docstring.
Thanks to James Harkins for the extra detailed reports and
the proposed solutions, both for org.el and org-mobile.el.
(if (org-on-heading-p) ; if false we are in top-level of file
(progn
(end-of-line 1)
- (org-insert-heading-respect-content)
+ (org-insert-heading-respect-content t)
(org-demote))
(beginning-of-line)
(insert "* "))
(org-move-subtree-down)
(end-of-line 1))
-(defun org-insert-heading-respect-content ()
- (interactive)
+(defun org-insert-heading-respect-content (invisible-ok)
+ "Insert heading with `org-insert-heading-respect-content' set to t."
+ (interactive "P")
(let ((org-insert-heading-respect-content t))
- (org-insert-heading t)))
+ (org-insert-heading t invisible-ok)))
(defun org-insert-todo-heading-respect-content (&optional force-state)
+ "Insert TODO heading with `org-insert-heading-respect-content' set to t."
(interactive "P")
(let ((org-insert-heading-respect-content t))
(org-insert-todo-heading force-state t)))