From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AIoFJRyox2Ok/AAAbAwnHQ (envelope-from ) for ; Wed, 18 Jan 2023 09:04:44 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AKIHJByox2O6ewAAG6o9tA (envelope-from ) for ; Wed, 18 Jan 2023 09:04:44 +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 3D364EF21 for ; Wed, 18 Jan 2023 09:04:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI3Qj-0006FO-TV; Wed, 18 Jan 2023 03:04:21 -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 1pI3Qi-0006Bf-60 for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 03:04:20 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI3Qg-0003og-Fr for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 03:04:19 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9BDD82401EA for ; Wed, 18 Jan 2023 09:04:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674029056; bh=ljOt1mbSy9mmTAODMfIminhRO/d4ijv3sxEKUfsLcmU=; h=From:To:Cc:Subject:Date:From; b=ThUT1F54Opi7zgHpBWzBFw+vwvq26RQEdgN3iRty5nVziDqJLyg6VD3E29msM/W/v AHS48rICHL8vjvj+tbE3xvZ1CrwC2XjLSHH1IDjyZIbCADFq3Rm3dgLn0hNu3u5Rpc f4MCSp49DyWCThdSsksjHcPc43q537px2gRsBkV3HN9OcCvG2TihJpq3a1+ETq2Wan lZoyFcNMVZkFkLDyVYI3LtYK7hRJpJ+xaqlazM531o7oJ8HGTTZTKoXKTx9DURmeWd xFcveb8W+o20uhyoR9J5QiuakCJ1OGOPVd5Q3xNruVU1R/nNI85g0ZMI2+10lytXnn gIe8SmRGuWI7A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NxdZP3Cb5z9rxG; Wed, 18 Jan 2023 09:04:13 +0100 (CET) From: Ihor Radchenko To: Philipp Kiefer Cc: emacs-orgmode@gnu.org Subject: Re: Make org-paste-subtree more predictable and useful In-Reply-To: References: Date: Wed, 18 Jan 2023 08:04:45 +0000 Message-ID: <87r0vs8e02.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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=1674029084; a=rsa-sha256; cv=none; b=HC3ri/orbj+yWlJBClZjTnDJ7dJeNWKCZMPKtKv1WCwtM9Nmtj43UsAM4srcmDGUzot2wd 3hcamglGjAAX8aYW/C9UU+HRWRrLKmbOOkLa0frn4//si9/bY+UmUoF1DGJ7ekigg94PGR ppBxQTWpc6mSWCYZeFXoHmkwBqHImrz5q51E5ER93VFM/Q6fANkFjejTaXiIQAzkj/aiCG fsyM+tvZQHlFXS8jLKqZzXIHdMlgs2+uZAZozkoXHr4aXZ/QVm5XTzYsxC8hN4MmxeYqkL mff0muODJnyn25mqSeaG5a4MvlOVFPDmGQFNDq902Ph9AIQpFYHylu9Iy0S0mA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ThUT1F54; dmarc=pass (policy=none) header.from=posteo.net; 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=1674029084; 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=QJF/+Uxs9IqjqPXXk64pCrmha/zxYHX+GcrNtyNhIro=; b=NcM8lvDodhEzysMHocn7q8p2OtOuhdtyw+tDCozsKWtnI+e+rx3J3DLShj0nGNsGW3psaE XBAiaxpGMneWAnmWG6rLSOekNho1S+MfWmMEVw09t83A3fk52LQ4yJ+TKJ6diVifhHVbJb BvAPxVzhpHeV2xG7yv8V/EsbX0+lw3FrmF5dlgfwOSDTaEych8+v4pHU24PBoaudnucOmk KOHTWy7WOUnd4UTcVayQdh1zYmD+KnJ4VzJIfLWhwrKo99E2rj8HXKvOWoUoY04ekBcMgf YuhvNVEpEw1Ej260RJxa4gICldMryqfa8rDRITf7k7X6TjgoNFirdCmvu/uOFA== X-Spam-Score: -10.18 X-Migadu-Queue-Id: 3D364EF21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ThUT1F54; dmarc=pass (policy=none) header.from=posteo.net; 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.18 X-TUID: 7cusci9w0I/r 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. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at