emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make org-paste-subtree more predictable and useful


From: Ihor Radchenko
Subject: Re: Make org-paste-subtree more predictable and useful
Date: Wed, 18 Jan 2023 08:04:45 +0000

Philipp Kiefer <phil.kiefer@gmail.com> writes:

> 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].
> ...
> 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.

AFAIU, `org-paste-subtree' already does what you want for the most part.
See the function docstring:

    Paste the clipboard as a subtree, with modification of headline level.
    
    The entire subtree is promoted or demoted in order to match a new headline
    level.
    
    If the cursor is at the beginning of a headline, the same level as
    that headline is used to paste the tree.
    
    If not, the new level is derived from the *visible* headings
    before and after the insertion point, and taken to be the inferior headline
    level of the two.  So if the previous visible heading is level 3 and the
    next is level 4 (or vice versa), level 4 will be used for insertion.
    This makes sure that the subtree remains an independent subtree and does
    not swallow low level entries.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]