From ece3091f16af246780e29ba6e8248dd8bb3b7ba2 Mon Sep 17 00:00:00 2001 From: David Maus Date: Wed, 10 Aug 2011 18:38:26 +0200 Subject: [PATCH] Don't eat headline when yank with point at existing headline * org.el (org-paste-subtree): Don't eat headline when called with point at existing headline. --- lisp/org.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4db12d571..ec190a364 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7530,8 +7530,8 @@ the inserted text when done." (force-level (cond (level (prefix-numeric-value level)) ((and (looking-at "[ \t]*$") (string-match - ^re_ (buffer-substring - (point-at-bol) (point)))) + "^\\*+$" (buffer-substring + (point-at-bol) (point)))) (- (match-end 1) (match-beginning 1))) ((and (bolp) (looking-at org-outline-regexp)) @@ -7568,7 +7568,7 @@ the inserted text when done." (if force-level (delete-region (point-at-bol) (point))) ;; Paste - (beginning-of-line 1) + (beginning-of-line (if (org-at-heading-p) 2 1)) (unless for-yank (org-back-over-empty-lines)) (setq beg (point)) (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt)) -- 2.11.4.GIT