|
@@ -13915,30 +13915,30 @@ org-yank-adjusted-subtrees
|
|
|
\[1] Basically, the test checks if the first non-white line is a heading
|
|
|
and if there are no other headings with fewer stars."
|
|
|
(interactive)
|
|
|
- (if org-yank-folded-subtrees
|
|
|
- (let ((beg (point))
|
|
|
- (subtreep (org-kill-is-subtree-p))
|
|
|
- end)
|
|
|
- (if (and subtreep org-yank-adjusted-subtrees)
|
|
|
- (org-paste-subtree nil nil 'for-yank)
|
|
|
- (call-interactively 'yank))
|
|
|
- (setq end (point))
|
|
|
- (goto-char beg)
|
|
|
- (when (and (bolp) subtreep)
|
|
|
- (or (looking-at outline-regexp)
|
|
|
- (re-search-forward (concat "^" outline-regexp) end t))
|
|
|
- (while (and (< (point) end) (looking-at outline-regexp))
|
|
|
- (hide-subtree)
|
|
|
- (org-cycle-show-empty-lines 'folded)
|
|
|
- (condition-case nil
|
|
|
- (outline-forward-same-level 1)
|
|
|
- (error (goto-char end)))))
|
|
|
- (goto-char end)
|
|
|
- (skip-chars-forward " \t\n\r"))
|
|
|
- (if (and subtreep org-yank-adjusted-subtrees)
|
|
|
- (org-paste-subtree nil nil 'for-yank)
|
|
|
- (call-interactively 'yank))))
|
|
|
-
|
|
|
+ (let ((subtreep (org-kill-is-subtree-p)))
|
|
|
+ (if org-yank-folded-subtrees
|
|
|
+ (let ((beg (point))
|
|
|
+ end)
|
|
|
+ (if (and subtreep org-yank-adjusted-subtrees)
|
|
|
+ (org-paste-subtree nil nil 'for-yank)
|
|
|
+ (call-interactively 'yank))
|
|
|
+ (setq end (point))
|
|
|
+ (goto-char beg)
|
|
|
+ (when (and (bolp) subtreep)
|
|
|
+ (or (looking-at outline-regexp)
|
|
|
+ (re-search-forward (concat "^" outline-regexp) end t))
|
|
|
+ (while (and (< (point) end) (looking-at outline-regexp))
|
|
|
+ (hide-subtree)
|
|
|
+ (org-cycle-show-empty-lines 'folded)
|
|
|
+ (condition-case nil
|
|
|
+ (outline-forward-same-level 1)
|
|
|
+ (error (goto-char end)))))
|
|
|
+ (goto-char end)
|
|
|
+ (skip-chars-forward " \t\n\r"))
|
|
|
+ (if (and subtreep org-yank-adjusted-subtrees)
|
|
|
+ (org-paste-subtree nil nil 'for-yank)
|
|
|
+ (call-interactively 'yank)))))
|
|
|
+
|
|
|
(define-key org-mode-map "\C-y" 'org-yank)
|
|
|
|
|
|
(defun org-invisible-p ()
|