[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] feature request: org-yank to call org-paste-subtree
From: |
Samuel Wales |
Subject: |
Re: [Orgmode] feature request: org-yank to call org-paste-subtree |
Date: |
Sun, 26 Oct 2008 01:35:48 -0700 |
I find that org-paste-subtree works perfectly all the time for
headlines, and that org-yank does not work for headlines any time the
levels are wrong. But I just started using them.
Approximate and prob wrong:
(defun org-yank-possibly-adjusted ()
(save-excursion
(if (and org-yank-adjust (org-kill-is-subtree-p))
(call-interactively 'org-paste-subtree)
(call-interactively 'yank))))
(defun org-yank ()
"Yank, and if the yanked text is a single subtree, fold it.
In fact, if the yanked text is a sequence of subtrees, fold all of them."
(interactive)
(if org-yank-folded-subtrees
(let ((beg (point)) end)
(org-yank-possibly-adjusted)
...