[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [feature] Cut & paste of subtree
From: |
Sebastien Vauban |
Subject: |
Re: [O] [feature] Cut & paste of subtree |
Date: |
Thu, 01 Nov 2012 13:20:09 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt) |
Hello Yagnesh,
Yagnesh Raghava Yakkala wrote:
> On 10月 31 2012, "Sebastien Vauban" <address@hidden> 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 <address@hidden>
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
- Re: [O] [feature] Cut & paste of subtree,
Sebastien Vauban <=