diff options
authorBastien Guerry <>2013-02-11 17:27:21 (GMT)
committer Bastien Guerry <>2013-02-13 18:26:50 (GMT)
commit6d7142b145d0398247a0dcd6cdec087693c08048 (patch)
parentfa3385e68bc8f306b5105d99950ba002a571befc (diff)
Fix `org-insert-heading-respect-content'
* 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.
2 files changed, 6 insertions, 4 deletions
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index a410de0..293d2a0 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -1064,7 +1064,7 @@ be returned that indicates what went wrong."
(if (org-on-heading-p) ; if false we are in top-level of file
(end-of-line 1)
- (org-insert-heading-respect-content)
+ (org-insert-heading-respect-content t)
(insert "* "))
diff --git a/lisp/org.el b/lisp/org.el
index 24fe451..56a870c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7231,12 +7231,14 @@ This is a list with the following elements:
(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)))