emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Philipp Kiefer <phil.kiefer@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Make org-paste-subtree more predictable and useful
Date: Tue, 17 Jan 2023 21:14:13 +0100	[thread overview]
Message-ID: <CAEGK9xkKyVP-rpW1MqQnrQkLUzc+bPjj06F0A7vkA_qGzFgR7A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

Hello there, orgmode list, this is my first contribution here, so please be
gentle with me.

I've now used outlining software for the last twenty years at least and it
is my belief that when a user pastes headlines into an outline, they
usually want to make them either A) siblings of (i. e. paste them at the
same level as) or B) children of (i. e. paste them one level below) the
currently focused heading.

Unfortunately, org-paste-subtree currently attempts to "modify the level of
the subtree to make sure the tree fits in nicely at the yank position"
[from Org Manual]. For me, this has meant unpredictable results. As far as
I know, there is currently no way to use the command while making sure the
result will be A) or B) as desired. The user has to wait for the command to
do its "magic" and then move the headings around manually to achieve the
intended result.
With a numeric prefix argument or by yanking after a headline marker, the
user can specify the yank level. But how likely is it that a user will yank
headings to level five under a level two heading?

I can solve my problem with some additional code, in which I determine the
level of the heading at point and then have two functions to call for same
level or child level respectively, but it strikes me as odd that this is
not part of the default options.

My suggestion would be to make a fundamental change to how the command
works, prioritizing definite A) or B) type results over the current vague
"the tree fits in nicely" approach. IMHO the default should be to yank at
the same level as the focused heading. Then, if the C-u 0 numeric prefix
(which currently produces an error message) were used to yank at one level
below that (as subheadings of the focused heading), the functionality of
the other numeric prefixes to set the yank level could be preserved.

Thanks for considering!

Best regards,

Philipp

[-- Attachment #2: Type: text/html, Size: 2175 bytes --]

             reply	other threads:[~2023-01-18  4:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 20:14 Philipp Kiefer [this message]
2023-01-18  8:04 ` Make org-paste-subtree more predictable and useful Ihor Radchenko
2023-01-18 15:41   ` Philipp Kiefer
2023-01-19  9:44     ` Ihor Radchenko
2023-01-19 17:31       ` Philipp Kiefer
2023-01-20 10:12         ` [BUG] org-paste-subtree level when point is in the middle of a heading (was: Make org-paste-subtree more predictable and useful) Ihor Radchenko
2023-01-20 10:21         ` [FR] Add C-u and C-u C-u prefix arguments to org-paste-subtree " Ihor Radchenko
2023-01-20 19:27           ` Philipp Kiefer

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=CAEGK9xkKyVP-rpW1MqQnrQkLUzc+bPjj06F0A7vkA_qGzFgR7A@mail.gmail.com \
    --to=phil.kiefer@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).