From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 0IWRDnfyFmZ4CwAA62LTzQ:P1 (envelope-from ) for ; Wed, 10 Apr 2024 22:11:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0IWRDnfyFmZ4CwAA62LTzQ (envelope-from ) for ; Wed, 10 Apr 2024 22:11:35 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=online.de header.s=s42582890 header.b=jb41pr7G; 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"; dmarc=pass (policy=none) header.from=online.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712779895; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CYipINQKtcH50e17aUSx3OpzB3pDQnUZMo9mmFs9K4I=; b=Q3qPrYHyRC/pg5zAISSEb4w+KHYvzZW2wD3qiJRVdXdaDIbCLqj23XtdOkz4iJeVEQpMRO 9/hqWGU+ikZbosxfOYNu7+4hxp5leLEGKR4C8awsolrWCSRU0GHlCMscNO784MEFJA5JOn OvmgrAwbAS++Q4As94P3A16X/O5DWNCuTbb57Vl9ny9c5Pikj0ZqsVygwO2shVnPZNYfnn 3mWAl5S8GQzcTsTp0pZFgh3gic/+ACg+wYm1XKqnQGjij5S7Voc059Ef2mFKIEMj4bwpnK uzeojbXYlOt/CCOgeGIgS6pFN4eQR21vFsxRMLyNSnHW+UmsqqKFacTWV6SZbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712779895; a=rsa-sha256; cv=none; b=tzJ1I8yjen978pFkAkJej/YqcQRQNYdul6hn44nm3VXGn/n0icGWpSlmIjH3ovhyDWTnWc 0N+yOGFDpN11p7K48V2QMgKMJA+HL/Nktr7X0xPb8tdTT2FfWH1PY3ZBBBHimUgEzKG2mO CZePRtpmoc7TJJqDMAj+t8VQgaGKguhP6gn1Mgo+38HZwL7RXMKwLJPwRC/HKoVoVNDaEr 7/D2m4a4KIB2YTsp9+q2/0GYbJ/XeBlteFFwlBB2dOXZT0gVmhb1VUM+TqsGIHYzcT5y2G fV7qSSXZ1xOT9OBiPFLLyfWn2n1OPjPC1vOUgOTlZeDAW6hmyz6rkzL3P4gmfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=online.de header.s=s42582890 header.b=jb41pr7G; 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"; dmarc=pass (policy=none) header.from=online.de 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 F2E5F17DAA for ; Wed, 10 Apr 2024 22:11:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rueGx-0006ys-5A; Wed, 10 Apr 2024 16:10:19 -0400 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 1rueGw-0006ye-1g for emacs-orgmode@gnu.org; Wed, 10 Apr 2024 16:10:18 -0400 Received: from mout.kundenserver.de ([212.227.126.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rueGs-0000hS-N4 for emacs-orgmode@gnu.org; Wed, 10 Apr 2024 16:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=online.de; s=s42582890; t=1712779810; x=1713384610; i=bch@online.de; bh=CYipINQKtcH50e17aUSx3OpzB3pDQnUZMo9mmFs9K4I=; h=X-UI-Sender-Class:From:To:Subject:Date; b=jb41pr7G7rktlktpjNhsEC8lvikyLQ7a0E0cJRKgxicW642IfSHfBd4PGRL1Z5pM 0pxvpr8lfB25A3wD3HO4lG1ezrW9zEJCphz+OxRUKxUVXXdMwjOj1WhZhODEyV0yl oJ74OwwIKor0lsStWMTuXizBdYQ40lmm2W6g9VjMyijDeoZkbex7YJelYOcjr2q9d Sm9sIxcXLlE++R0m468TmID0BJdeSfQdWWhY3YGgciXK7/RLOrFPa+9hNe7Ik074P aCcV75YgcPDmLBi0YNZldM+AaUUzCwqGoM9iyr+rBXT7UgOnZMR8cxOreSfhVx7zB 7mFkEUFkZLK0AbQPDg== X-UI-Sender-Class: 6003b46c-3fee-4677-9b8b-2b628d989298 Received: from shell.onfire.org ([88.198.95.166]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M6lxe-1rqnC03XNW-00DRoj; Wed, 10 Apr 2024 22:10:10 +0200 From: Christian Barthel To: emacs-orgmode@gnu.org Subject: org-clone-subtree-with-time-shift with reverse order X-Gpg-Key: https://onfire.org/bch/pgp/pubkey.asc X-Archive: expiry=7 Date: Wed, 10 Apr 2024 22:10:10 +0200 Message-ID: <87le5lyo65.fsf@shell.onfire.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:RYcrGbmGNJaY/Vv6AHui/vfc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elope-from=bch@online.de; helo=mout.kundenserver.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.89 X-Spam-Score: -8.89 X-Migadu-Queue-Id: F2E5F17DAA X-Migadu-Scanner: mx12.migadu.com X-TUID: njjKemWq3Vps --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I'd like to suggest adding a new prefix arg i.e. `C-u C-u org-clone-subtree-with-item-shift' to reverse the order of newly created / cloned siblings. Would that be of interest for other orgmode users? Diff file is attached. =2D- Christian Barthel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org.el-prepend.patch Content-Transfer-Encoding: quoted-printable diff -u --label \#\ --label \#\ /tmp/= buffer-content-gd7Tiz /tmp/buffer-content-QbeeNi =2D-- # +++ # @@ -7342,7 +7342,11 @@ As described above, N+1 clones are produced when the original subtree has a repeater. Setting N to 0, then, can be used to remove the repeater from a subtree and create a shifted clone -with the original repeater." +with the original repeater. + +The new siblings will normally be appended. When using `C-u C-u' +prefix argument, the siblings will be prepended. +" (interactive "nNumber of clones to produce: ") (unless (wholenump n) (user-error "Invalid number of replications %s" n= )) (when (org-before-first-heading-p) (user-error "No subtree to clone")) @@ -7388,7 +7392,7 @@ (setq nmin 0) (setq nmax (1+ nmax)) (setq n-no-remove nmax)) - (goto-char end) + (goto-char (if (equal current-prefix-arg '(16)) beg end)) (cl-loop for n from nmin to nmax do (insert ;; Prepare clone. @@ -7418,7 +7422,8 @@ (goto-char (match-beginning 0)) (when (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[hdwmy]\\)") (delete-region (match-beginning 1) (match-end 1))))))) - (buffer-string))))) + (buffer-string))) + (if (equal current-prefix-arg '(16)) (goto-char beg)))) (goto-char beg))) ;;; Outline path Diff finished. Wed Apr 10 11:42:21 2024 --=-=-=--