From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6KNKC2sTyGPZdwAAbAwnHQ (envelope-from ) for ; Wed, 18 Jan 2023 16:42:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GP/7CmsTyGMycAEAauVa8A (envelope-from ) for ; Wed, 18 Jan 2023 16:42:35 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ACC6C311A8 for ; Wed, 18 Jan 2023 16:42:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIAZe-00087h-9O; Wed, 18 Jan 2023 10:42:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIAZc-00087N-Vm for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 10:42:00 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIAZa-0006M1-Sf for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 10:42:00 -0500 Received: by mail-ej1-x634.google.com with SMTP id ss4so76927460ejb.11 for ; Wed, 18 Jan 2023 07:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=O8nhNdRdWfhBOFBA74utqKOeBzCGiB1H0SfTqkXWeUs=; b=ZdwHnRDIXdlr1J1aoQ1nye1JziJmgJ5gsg8I4R7GWZS5j0aPn/jiNdWvWJ1twTcIw4 yD1W9h2Km3luBoSu7BjGyECf7r/gih9KoIgefeDj+0m+vgvOPWBri9dCQat8akgREInZ OVjk+XqWZzEbYVIJSQ6E5ZueYyRM0C4XZAodqiFb0GLTDSuCa/W9YNO0w+9MBvsOU58x kWG3ZweFnQvV20cL5fVNBICO/DbW0g3e1Bl8Erb/kYLCbfgWNK/8Gr0xOeYuWMgt/N06 z2cjzbU4sQMWJ5zf1G0PAb6mO1pd1gvll2sihrzemxpQSl4v2IetD0pNuiyJsuKLiP+b DUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O8nhNdRdWfhBOFBA74utqKOeBzCGiB1H0SfTqkXWeUs=; b=NeoZgB8xo/igOjcCNhCXtVr/S1qtV+NtUatY2QnJEpaWVs0JcNVBmrPUEKs7NFYWat o7HWgJbOgcLwA0QxB2muiQvOLWfZHKGqyfgeiruyr+43tFR2PB9I/iurCxchu1V6Oo4E DjaqIykUY2uMq2OR9HQp/8BbbwZrdz+gYyRnyKQandKQ57XgOJsyZrYoyobmYvOqcaMz alRnllHQRyF7NfpWvK3clNMib1EDTQT8Iqb6JPRHcqZ9ptcRioLotLL7Vww5L22NqWXC 5G2wGPb15VTZzCIXboNfON7DWsU0bLehRI0h472JOfdQVRdozGdWWWx7V3hXspk0+Jzv WbeA== X-Gm-Message-State: AFqh2kpLqkbNanpXBEAmtmG/2tWltWVr1Ry4XYj7gRmgMrVG6Y3ZUQxm NlU0weFlVVeUZ9qaIo2zZYw= X-Google-Smtp-Source: AMrXdXvb0i2PKHxrtVZXlyWcEQw/qWWL/c08qthu57I0/uKpH4EHcEDVLH5Cc+zqsDAsBNezWDBH8g== X-Received: by 2002:a17:906:cd1f:b0:84d:4a2b:73b9 with SMTP id oz31-20020a170906cd1f00b0084d4a2b73b9mr8089570ejb.59.1674056517037; Wed, 18 Jan 2023 07:41:57 -0800 (PST) Received: from [192.168.178.58] (55d4768b.access.ecotel.net. [85.212.118.139]) by smtp.gmail.com with ESMTPSA id 21-20020a170906301500b007c0985aa6b0sm14867892ejz.191.2023.01.18.07.41.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 07:41:56 -0800 (PST) Content-Type: multipart/alternative; boundary="------------WFxbpLpmx7bLb0FfzSFwztmW" Message-ID: <2eebe03e-fda5-f879-2643-2c9a146dd23e@gmail.com> Date: Wed, 18 Jan 2023 16:41:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Make org-paste-subtree more predictable and useful Content-Language: de-DE To: Ihor Radchenko Cc: emacs-orgmode@gnu.org References: <87r0vs8e02.fsf@localhost> From: Philipp Kiefer In-Reply-To: <87r0vs8e02.fsf@localhost> Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=phil.kiefer@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.089, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674056554; a=rsa-sha256; cv=none; b=Oc7urpBUUtbRlObhN2fPsccNvsm1XDl4zQ/KiERCW5KBCGVf5u75ZUL5MIQWIqjMZr7DYi 16VOjYvClvwkNHLbdm55NHHV6uyntvmK2/FOvri2po1Q4KUnPjhafV2vY/o6FSbCVSG6ZY pxPQvy9VcVzU2/NJHTOqGWfovgT+2xOL3QmTJ6gEM2PnG97q5bLC2uxqOPiJbP70C/1eJ5 q6/v/cZ09sOH3rVQ5DWiZYEgiyx3fyM3I6EJF5d0uUT/SwoBHC7WctStObHihGftcHJSMN /GlGWuzq5zsIjyoR4CLHRIsLWyLzMEH4GrGPwuKCJAL1kO6NXoY3OvlW+9e+ig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZdwHnRDI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674056554; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=O8nhNdRdWfhBOFBA74utqKOeBzCGiB1H0SfTqkXWeUs=; b=X7hAdRDeoTAWzYcwnEGc6s5XmS2wEFwW0+JXdVFM4sWOQtx+P8abfs2tW8Z8zsKdiOtaGa tzQQMqWrzWPRdsJSLxaBwIRNlHKPDnGbeHqtNpr+KF4o/MSbkmHqZHYsVFM+w9DMrTbts0 JwOrWz6RqSVy5hjy5CqWkoH4hx9eVuTZdmpaysDXxBd8qSkz4KGtIXHDUKLnKD2GtocxVc Emz0JsPGVPBVc33UnP6RHkgcnqGbAZTlAMFgP82jjJtCPr+DFigIiSt+LMPWLumcrsDaIw 74mbEMiZ0h6OxsUCLOOMNe17ffTHQEuEq9rASS0LCWIWXgmVNTr//TSkpAoRgA== X-Spam-Score: -10.29 X-Migadu-Queue-Id: ACC6C311A8 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZdwHnRDI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -10.29 X-TUID: jzerlnBJDYsj This is a multi-part message in MIME format. --------------WFxbpLpmx7bLb0FfzSFwztmW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for addressing my concern, Ihor. So I can force same-level yank by navigating to the beginning of the current headline before calling org-paste-subtree, I see. However, I still do not see a way to force it to paste one level below the current headline, i. e. to add the trees on the clipboard as child-subtrees or the current heading. My best bet currently is probably to create a blank child heading, add some text (there seems to be a glitch turning the blank heading into an empty line when pasting with point on the blank dummy heading when it has no text), go back to the beginning of the line, then paste the subtrees at the level of the dummy heading, navigate back to the dummy heading and delete it. I'd really rather not have to do all that to achieve my simple goal of pasting subtrees at child level. As for the claim that the current procedure "makes sure that the subtree remains an independent subtree and does not swallow low level entries.", either I don't understand it or it isn't true. If I have a level 2 heading below which is a level 5 heading and I paste subtrees with point on the level 2 heading, the level 5 heading is subsumed under the last subtree yanked from the clipboard in all cases. Best, Philipp On 18.01.2023 09:04, Ihor Radchenko wrote: > Philipp Kiefer 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. > --------------WFxbpLpmx7bLb0FfzSFwztmW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Thanks for addressing my concern, Ihor.

So I can force same-level yank by navigating to the beginning of the current headline before calling org-paste-subtree, I see. However, I still do not see a way to force it to paste one level below the current headline, i. e. to add the trees on the clipboard as child-subtrees or the current heading.

My best bet currently is probably to create a blank child heading, add some text (there seems to be a glitch turning the blank heading into an empty line when pasting with point on the blank dummy heading when it has no text), go back to the beginning of the line, then paste the subtrees at the level of the dummy heading, navigate back to the dummy heading and delete it. I'd really rather not have to do all that to achieve my simple goal of pasting subtrees at child level.

As for the claim that the current procedure "makes sure that the subtree remains an independent subtree and does not swallow low level entries.", either I don't understand it or it isn't true. If I have a level 2 heading below which is a level 5 heading and I paste subtrees with point on the level 2 heading, the level 5 heading is subsumed under the last subtree yanked from the clipboard in all cases.

Best,

Philipp

On 18.01.2023 09:04, Ihor Radchenko wrote:
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.

--------------WFxbpLpmx7bLb0FfzSFwztmW--