emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <i.lohmar@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Heading/item insert commands
Date: Tue, 03 Oct 2017 20:52:54 +0200	[thread overview]
Message-ID: <87d1649i7t.fsf@acer.localhost.com> (raw)


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

             reply	other threads:[~2017-10-03 18:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 18:52 Ingo Lohmar [this message]
2017-10-04 10:33 ` Heading/item insert commands Nicolas Goaziou
2017-10-04 11:27   ` Ingo Lohmar
2017-10-06 17:54     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1649i7t.fsf@acer.localhost.com \
    --to=i.lohmar@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).