From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Re: Bug: org-insert-heading-respect-content inserts at the wrong level if target heading is invisible [7.9.2 (release_7.9.2-883-g6fb36e.dirty @ /home/dlm/share/org-mode.git/lisp/)] Date: Wed, 13 Mar 2013 17:03:26 +0800 Message-ID: References: <874ni598fq.wl%jamshark70@dewdrop-world.net> <87k3qebvw4.fsf@bzg.ath.cx> <87a9r7gsji.fsf@bzg.ath.cx> <87mwujdp87.fsf@bzg.ath.cx> Reply-To: jamshark70@dewdrop-world.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFhb0-00082C-2O for Emacs-orgmode@gnu.org; Wed, 13 Mar 2013 05:03:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFhaq-000515-1N for Emacs-orgmode@gnu.org; Wed, 13 Mar 2013 05:03:38 -0400 In-Reply-To: <87mwujdp87.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien , Emacs-orgmode@gnu.org On Tue, Mar 5, 2013 at 1:41 AM, Bastien wrote: > There is some obscure issues here... I fixed various things in > `org-insert-heading' in master, but inserting in invisible parts of > the subtree is still unstable. So I went and used the workaround you > suggested (i.e. org-show-subtree) in the maint branch, so that it will > be in 7.9.4. Apologies -- this seems to be the issue that wouldn't die -- but I have to report another failure with this. I just did org-mobile-pull with the following entry: ~~ * F(edit:addheading) [[olp:semester.org:Dates][Dates]] ** Old value ** New value Graduating exams the modern music Important Notice:..... ** End of edit ~~ This means the new heading should be at the second level, underneath Dates. Instead, it was added as the topmost *first* level heading: ~~ BEFORE #+LAST_MOBILE_CHANGE: 2013-03-13 16:38:42 * Dates ** DONE Teachers' meeting ~~ ~~ AFTER * Graduating exams the modern music Important Notice:....#+LAST_MOBILE_CHANGE: 2013-03-13 16:38:42 * Dates ** DONE Teachers' meeting ~~ ~~ EXPECTED #+LAST_MOBILE_CHANGE: 2013-03-13 16:38:42 * Dates ** DONE Teachers' meeting ** ... a few other level 2 headings ... ** Graduating exams the modern music Important Notice:.... ~~ Also, "#+LAST_MOBILE_CHANGE:" should be the first line in any org file that's being synced to MobileOrg, but (org-insert-heading-respect-content '(4) t) ignores this. BTW, I believe the arg '(4) is incorrect. In MobileOrg (at least in android -- actually, I think the iPhone doesn't support this feature yet), new nodes go to the bottom of the parent's children. They should not be inserted at the top in Emacs. This is slightly different from the earlier bug. "* Dates" *is* a top-level heading in the target file -- hence, it *can't* be invisible. Nonetheless, when inserting the new heading, it seems to be reading the level of the target node as level 0, rather than level 1. After that, the new node goes at the top of level 1 (which will also obliterate any #+ preamble the file might have). This may be a recent issue. I updated via git after you said that you had put my workaround in place, and I don't remember seeing this problem before. New second-level nodes did go into the right places. I saw this issue only today (git pull yesterday). Thanks... hjh