summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Maus <dmaus@ictsoc.de>2011-08-10 18:38:26 +0200
committerDavid Maus <dmaus@ictsoc.de>2011-08-10 18:38:26 +0200
commitece3091f16af246780e29ba6e8248dd8bb3b7ba2 (patch)
treea24861ead2ea22f2d2f94286c0881b0f2aaca9c3
parent14b556772be6245e427cc2f5317680dfeb7b4c74 (diff)
downloadorg-mode-ece3091f16af246780e29ba6e8248dd8bb3b7ba2.tar.gz
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.
-rw-r--r--lisp/org.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 4db12d5..ec190a3 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))