summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-02-26 12:14:24 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-02-26 12:14:24 +0100
commita0104599dc2fd030df60b9a056fb912ac9284bc1 (patch)
treee6174049a4e083cfe34ee47f26c9af1864f07ae8
parentfffd300efdfa21211c99955b3f9bbc7a1d23e5f8 (diff)
downloadorg-mode-a0104599dc2fd030df60b9a056fb912ac9284bc1.tar.gz
Fix `org-paste-subtree'
* lisp/org.el (org-paste-subtree): Use `org-outline-regexp-bol'. The function cannot detect the proper level when a headline around point contains spurious white spaces after the stars.
-rw-r--r--lisp/org.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 636a9ce..b1d369c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8536,7 +8536,6 @@ When REMOVE is non-nil, remove the subtree from the clipboard."
(org-with-limited-levels
(let* ((visp (not (org-invisible-p)))
(txt tree)
- (^re_ "\\(\\*+\\)[ \t]*")
(old-level (if (string-match org-outline-regexp-bol txt)
(- (match-end 0) (match-beginning 0) 1)
-1))
@@ -8553,7 +8552,7 @@ When REMOVE is non-nil, remove the subtree from the clipboard."
(condition-case nil
(progn
(outline-previous-visible-heading 1)
- (if (looking-at ^re_)
+ (if (looking-at org-outline-regexp-bol)
(- (match-end 0) (match-beginning 0) 1)
1))
(error 1))))
@@ -8562,7 +8561,7 @@ When REMOVE is non-nil, remove the subtree from the clipboard."
(progn
(or (looking-at org-outline-regexp)
(outline-next-visible-heading 1))
- (if (looking-at ^re_)
+ (if (looking-at org-outline-regexp-bol)
(- (match-end 0) (match-beginning 0) 1)
1))
(error 1))))