emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [feature] Cut & paste of subtree
Date: Thu, 01 Nov 2012 13:20:09 +0100	[thread overview]
Message-ID: <80bofhldl2.fsf@somewhere.org> (raw)
In-Reply-To: 87liemk5rg.fsf@yagnesh.org

Hello Yagnesh,

Yagnesh Raghava Yakkala wrote:
> On 10月 31 2012, "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org> wrote:
>> Since more or less one month or so, I've seen a change in the behavior of 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 <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
Date: Thu, 1 Nov 2012 13:04:19 +0100
Subject: [PATCH] When pasting a copied subtree, respect the whitelines before
 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

  reply	other threads:[~2012-11-01 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 11:06 [feature] Cut & paste of subtree Sebastien Vauban
2012-10-31 15:42 ` Yagnesh Raghava Yakkala
2012-11-01 12:20   ` Sebastien Vauban [this message]
2012-11-01 13:19     ` Yagnesh Raghava Yakkala
2012-11-01 14:18       ` Sebastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80bofhldl2.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).