From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: [patch] org-mobile-edit: Fix "addheading" parent-level bug Date: Wed, 30 Jan 2013 10:53:12 +0800 Message-ID: Reply-To: jamshark70@dewdrop-world.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8ff1ce4274e43204d4789c27 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0Nna-0006ea-4o for Emacs-orgmode@gnu.org; Tue, 29 Jan 2013 21:53:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0NnW-00044U-Gc for Emacs-orgmode@gnu.org; Tue, 29 Jan 2013 21:53:18 -0500 Received: from mail-ob0-f180.google.com ([209.85.214.180]:34124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0NnW-00044I-Ar for Emacs-orgmode@gnu.org; Tue, 29 Jan 2013 21:53:14 -0500 Received: by mail-ob0-f180.google.com with SMTP id ef5so1195218obb.11 for ; Tue, 29 Jan 2013 18:53:13 -0800 (PST) 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: Emacs-orgmode@gnu.org --e89a8ff1ce4274e43204d4789c27 Content-Type: text/plain; charset=ISO-8859-1 I've sent some messages to this list about a bug that manifests in org-mobile (although the cause is in orgmode itself, and is not specific to org-mobile). One of those messages is a bug report, with steps to reproduce that do not depend on having MobileOrg set up (so anyone can look at it, not only MobileOrg users). The bug report hasn't been processed yet, though (I assume because Bastien and others are busy). This is a pretty serious issue for MobileOrg users, so... I have a workaround, in the attached patch. Tested and works. I call it a workaround because it doesn't actually fix the root problem, which is that org-insert-heading-respect-content doesn't do the right thing when called non-interactively on an invisible heading. If someone writes a clever lisp function that uses org-insert-heading-respect-content without explicitly showing the entry, she will run into the same problem that MobileOrg has now. So this does not supersede the bug report. It's just a band-aid so that MobileOrg users' outline structures don't get corrupted when syncing new nodes from the mobile into Emacs. Unfortunately, I've taken the issue as far as I can and I just don't understand where org-insert-heading is going wrong. In any case, corruption of the outline structure is reason enough to apply the workaround without waiting for a "real" fix. hjh -- James Harkins /// dewdrop world jamshark70@dewdrop-world.net http://www.dewdrop-world.net "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks --e89a8ff1ce4274e43204d4789c27 Content-Type: application/octet-stream; name="0001-Workaround-for-an-issue-causing-new-nodes-to-be-adde.patch" Content-Disposition: attachment; filename="0001-Workaround-for-an-issue-causing-new-nodes-to-be-adde.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hcjvqepb0 RnJvbSBkZjg4ODVjOTFhOTlkMDUyMjRkZjk4ZDJhODZjZDYwOGY4YzI0YWMxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYW1lcyBIYXJraW5zIDxqYW1zaGFyazcwQGRld2Ryb3Atd29y bGQubmV0PgpEYXRlOiBXZWQsIDMwIEphbiAyMDEzIDEwOjQwOjM1ICswODAwClN1YmplY3Q6IFtQ QVRDSF0gV29ya2Fyb3VuZCBmb3IgYW4gaXNzdWUgY2F1c2luZyBuZXcgbm9kZXMgdG8gYmUgYWRk ZWQgYXQgdGhlCiB3cm9uZyBsZXZlbAoKQWRkaW5nIGEgbmV3IGhlYWRpbmcgaW4gTW9iaWxlT3Jn IHVzZXMKb3JnLWluc2VydC1oZWFkaW5nLXJlc3BlY3QtY29udGVudC4gVGhpcyBmdW5jdGlvbiBk b2VzIG5vdCBiZWhhdmUKY29ycmVjdGx5IGlmIHRoZSBwYXJlbnQgbm9kZSBpcyBpbnZpc2libGUg YXQgdGhlIHRpbWUgb2Yg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