From a0104599dc2fd030df60b9a056fb912ac9284bc1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 26 Feb 2018 12:14:24 +0100 Subject: [PATCH] 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. --- lisp/org.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 636a9ce34..b1d369c70 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))))