[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Kill all items with specific tag to kill-ring.
From: |
Oleksandr Gavenko |
Subject: |
Re: [O] Kill all items with specific tag to kill-ring. |
Date: |
Thu, 25 Apr 2013 08:21:54 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Carsten Dominik <carsten.dominik <at> gmail.com> writes:
>
> On 25.4.2013, at 07:32, Oleksandr Gavenko <gavenkoa <at> gmail.com> wrote:
>
> > I use tags only on top level items in org-file.
> >
> > And want move all items marked by specific tag to different org-file.
> >
> > I expect that this command kill items with selected tag to kill-ring in one
> > step (so single undo command return original buffer content).
> >
> > Seems there are no such command build-in command...
>
> no, but you could easily make one using the function org-map-entries.
>
I finish with very hackie code (based on knowledge of internal
implementation of org-scan-tags):
(defun my-org-kill-by-tag (tag)
(interactive (list (read-input "Enter tag: ")))
(kill-new "")
(org-scan-tags
(lambda ()
(let ( (last-command 'kill-region) )
(org-cut-subtree)))
'(member tag tags-list)
nil) )
You can replace 'org-cut-subtree' by 'org-copy-subtree' if don't want remove
org entries...
- [O] Kill all items with specific tag to kill-ring., Oleksandr Gavenko, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Carsten Dominik, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring.,
Oleksandr Gavenko <=
- Re: [O] Kill all items with specific tag to kill-ring., Carsten Dominik, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Oleksandr Gavenko, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Carsten Dominik, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Oleksandr Gavenko, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Bernt Hansen, 2013/04/25
- Re: [O] Kill all items with specific tag to kill-ring., Oleksandr Gavenko, 2013/04/29