From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: org-insert-heading rewritten from scratch Date: Mon, 9 Sep 2013 18:42:20 +0200 Message-ID: References: <6570EFE0-1DCA-44D1-AAD9-BE51A278EE58@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c32e8865c1c804e5f612bb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ4Xf-0007xZ-T2 for emacs-orgmode@gnu.org; Mon, 09 Sep 2013 12:42:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJ4Xe-0003Ds-IY for emacs-orgmode@gnu.org; Mon, 09 Sep 2013 12:42:23 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:39042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJ4Xe-0003DX-6J for emacs-orgmode@gnu.org; Mon, 09 Sep 2013 12:42:22 -0400 Received: by mail-la0-f46.google.com with SMTP id eh20so5146457lab.33 for ; Mon, 09 Sep 2013 09:42:20 -0700 (PDT) In-Reply-To: <6570EFE0-1DCA-44D1-AAD9-BE51A278EE58@gmail.com> 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: Carsten Dominik Cc: Emacs Org mode mailing list --001a11c32e8865c1c804e5f612bb Content-Type: text/plain; charset=ISO-8859-1 Hi Carsten On Thu, Aug 8, 2013 at 8:43 AM, Carsten Dominik wrote: > I have rewritten org-insert-heading, because it had become an unmaintainable beast. > Please follow up in this thread if you find problems with the new implementation. > Very likely there will be bugs, but now I am at least confident they can be fixed. On the way of rewiring my muscle memory from C-RET to M-RET for some cases, I stumbled across this: #+DRAWERS: MyStructuredDrawer :MyStructuredDrawer: - a :END: To insert a new item I once changed to use C-RET also on items. How is one supposed to do this now within a drawer? M-RET just inserts an empty line. I would like to suggest the attached patches with an ERT. They change (fix?) org-meta-return to insert a new item in this case. About the following different issue I don't care as much and only wanted to report: C-RET before any headline when within a drawer, or generally before any headline(?), could bark instead of changing to a headline leading to invalid Org syntax within a drawer. Michael --001a11c32e8865c1c804e5f612bb Content-Type: text/plain; charset=US-ASCII; name="0001-Add-ERTs-for-org-meta-return.patch.txt" Content-Disposition: attachment; filename="0001-Add-ERTs-for-org-meta-return.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hldx4cha0 RnJvbSA2YmM0YzE1YzRhNzZhOThjODQxZThhMjAwYzc1ZjVhMDczN2ZmZWNlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWVsIEJyYW5kIDxtaWNoYWVsLmNoLmJyYW5kQGdtYWls LmNvbT4KRGF0ZTogTW9uLCA5IFNlcCAyMDEzIDE4OjM4OjU4ICswMjAwClN1YmplY3Q6IFtQQVRD SCAxLzJdIEFkZCBFUlRzIGZvciBvcmctbWV0YS1yZXR1cm4KCiogdGVzdGluZy9saXNwL3Rlc3Qt b3JnLWxpc3QuZWwgKHRlc3Qtb3JnLWxpc3QvaW5zZXJ0LWl0ZW0pOiBBZGFwdApkb2NzdHJpbmcu CiogKHRlc3Qtb3JnLWxpc3QvbWV0YS1yZXR1cm4pOiBOZXcgYGVydC1kZWZ0ZXN0JyB0byB0ZXN0 CmBvcmctbWV0YS1yZXR1cm4nLgotLS0KIHRlc3RpbmcvbGlzcC90ZXN0LW9yZy1saXN0LmVsIHwg MTggKysrKysrKysrKysrKysrKystCiAxIGZpbGUgY2hhbmdlZCwgMTcgaW5zZXJ0aW9ucygrKSwg MSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL3Rlc3RpbmcvbGlzcC90ZXN0LW9yZy1saXN0LmVs IGIvdGVzdGluZy9saXNwL3R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td2l0aC10ZW1wLXRleHQgIjpNWURSQVdFUjpcbi0g YVxuOkVORDoiCisgICAgICAgKGZvcndhcmQtbGluZSkKKyAgICAgICAob3JnLW1ldGEtcmV0dXJu KQorICAgICAgIChmb3J3YXJkLWxpbmUgLTEpCisgICAgICAgKGxvb2tpbmctYXQgIiQiKSkpKSkK KwogKGVydC1kZWZ0ZXN0IHRlc3Qtb3JnLWxpc3QvcmVwYWlyICgpCiAgICJUZXN0IGBvcmctbGlz dC1yZXBhaXInIHNwZWNpZmljYXRpb25zLiIKICAgOzsgUmVwYWlyIGluZGVudGF0aW9uLgotLSAK MS43LjEyLjQgKEFwcGxlIEdpdC0zNykKCg== --001a11c32e8865c1c804e5f612bb Content-Type: text/plain; charset=US-ASCII; name="0002-org-meta-return-Insert-an-item-also-in-a-drawer.patch.txt" Content-Disposition: attachment; filename="0002-org-meta-return-Insert-an-item-also-in-a-drawer.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hldx4chm1 RnJvbSA5ODk2NDk5ZmI3ZjQ5N2ExMzg1N2I1Yjg2ZjMzY2ZiZjFiOTE4MDI5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWVsIEJyYW5kIDxtaWNoYWVsLmNoLmJyYW5kQGdtYWls LmNvbT4KRGF0ZTogTW9uLCA5IFNlcCAyMDEzIDE4OjQwOjA3ICswMjAwClN1YmplY3Q6IFtQQVRD SCAyLzJdIG9yZy1tZXRhLXJldHVybjogSW5zZXJ0IGFuIGl0ZW0gYWxzbyBpbiBhIGRyYXdlcgoK KiBsaXNwL29yZy5lbCAob3JnLW1ldGEtcmV0dXJuKTogRXhjbHVkZSBpdGVtIGZyb20gY29uZCBm b3IgZHJhd2VyLgoqIHRlc3RpbmcvbGlzcC90ZXN0LW9yZy1saXN0LmVsICh0ZXN0LW9yZy1saXN0 L21ldGEtcmV0dXJuKTogT24gYW4KaXRlbSBpbiBhIGRyYXdlciBleHBlY3QgYW4gaX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