From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [feature] Cut & paste of subtree Date: Thu, 01 Nov 2012 13:20:09 +0100 Message-ID: <80bofhldl2.fsf@somewhere.org> References: <80ip9q99ys.fsf@somewhere.org> <87liemk5rg.fsf@yagnesh.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Yagnesh, Yagnesh Raghava Yakkala wrote: > On 10=E6=9C=88 31 2012, "Sebastien Vauban" wrote: >> Since more or less one month or so, I've seen a change in the behavior o= f C-c >> C-x C-w, when cutting and pasting a subtree. > > I did know about this key binding, thanks for letting me know.. > > generally I go to the beginning of the heading I fold it and cut it., may= be > work around for you.. > > coming the problem, I can confirm the behavior. > > A shot in the dark. I tested your patch. It does what it should -- thanks! However, testing it with C-c C-x C-y (for pasting the subtree), I've discovered there was a need to remove the same type of line in org-paste-subtree. The following patch does it all. Thanks for your help. >From b644b0bd2aaf9c19c62d60b69702733e4999a11d Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Thu, 1 Nov 2012 13:04:19 +0100 Subject: [PATCH] When pasting a copied subtree, respect the whitelines befo= re and after * org.el (org-copy-subtree, org-paste-subtree): Remove badly inserted whitelines, when pasting a copied subtree. --- lisp/org.el | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 67e41e5..39e741b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7721,7 +7721,6 @@ useful if the caller implements cut-and-paste as copy= -then-paste-then-cut." (if (org-called-interactively-p 'any) (org-back-to-heading nil) ; take what looks like a subtree (org-back-to-heading t)) ; take what is really there - (org-back-over-empty-lines) (setq beg (point)) (skip-chars-forward " \t\r\n") (save-match-data @@ -7731,7 +7730,6 @@ useful if the caller implements cut-and-paste as copy= -then-paste-then-cut." (org-forward-heading-same-level (1- n) t) (error nil)) (org-end-of-subtree t t)) - (org-back-over-empty-lines) (setq end (point)) (goto-char beg0) (when (> end beg) @@ -7822,7 +7820,6 @@ the inserted text when done." (delete-region (point-at-bol) (point))) ;; Paste (beginning-of-line (if (bolp) 1 2)) - (unless for-yank (org-back-over-empty-lines)) (setq beg (point)) (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) (insert-before-markers txt) -- 1.7.9 Best regards, Seb -- Sebastien Vauban