From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Lohmar Subject: Heading/item insert commands Date: Tue, 03 Oct 2017 20:52:54 +0200 Message-ID: <87d1649i7t.fsf@acer.localhost.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzSJS-00076b-CO for emacs-orgmode@gnu.org; Tue, 03 Oct 2017 14:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzSJO-0001tH-FS for emacs-orgmode@gnu.org; Tue, 03 Oct 2017 14:53:02 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:56578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzSJO-0001nz-9O for emacs-orgmode@gnu.org; Tue, 03 Oct 2017 14:52:58 -0400 Received: by mail-wm0-x22b.google.com with SMTP id l68so5038168wmd.5 for ; Tue, 03 Oct 2017 11:52:57 -0700 (PDT) Received: from localhost (xdsl-78-35-232-36.netcologne.de. [78.35.232.36]) by smtp.gmail.com with ESMTPSA id y21sm10997139edi.25.2017.10.03.11.52.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 11:52:55 -0700 (PDT) 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" To: emacs-orgmode@gnu.org Dear All, I have been heavily and happily using orgmode for more than 6 years now. During this time, I have returned 4 or 5 times to changing, tweaking and generally being puzzled by the code and commands used to insert headings and list items. Now, for the first time, I have tried to systematically write down for myself the different dimensions of the problem, what kind of combinations I want, and I have written small wrapper commands that make it happen the way I want. But that has basically confirmed my gut feeling that the code dealing with these tasks is fairly convoluted. There is no symmetry between todo/non-todo elements, nor between headings and plain list items (inasmuch as possible), arguments are used inconsistently, heading insertion may or may not fallback to list items etc. Thankfully, we are not talking about a lot of code, and it seems to be amenable to refactoring. Is there any interest in me trying that (no promises as to the success)? I could not find any previous discussions about this topic, but wanted to get some feedback before spending my time on this. To me, there are a few dimensions of requirements: - insert a heading or an item, or decide based on context? - insert a todo or a non-todo something? - insert right here (possibly splitting a line), after the current something, or at the end of current's something parent? Plus some specialties of the current code: For a todo heading, which keyword to use? Override the heading level by an argument? What I have in mind for starters: Add orthogonal internal functions that can handle *all* sensible combinations of requirements. Then rewrite existing commands in terms of these, but possibly adding new ones. I would not want to break any workflows, of course. But in the *long* run, we could rethink if the existing commands and their prefix-arg behavior are really what users want, or if we provide other ones by default. Does that sound reasonable, or are there any grave obstacles I did not consider, or any hard reasons why such changes could not be accepted? Thanks, Ingo