From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleksandr Gavenko Subject: Re: Kill all items with specific tag to kill-ring. Date: Thu, 25 Apr 2013 08:21:54 +0000 (UTC) Message-ID: References: <87haivyy3h.fsf@gavenkoa.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVHRU-0007bh-PL for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 04:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVHRQ-0007Ul-4y for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 04:22:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:39125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVHRP-0007UX-HN for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 04:22:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UVHRM-0003j9-EH for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 10:22:04 +0200 Received: from 217.117.64.200 ([217.117.64.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Apr 2013 10:22:04 +0200 Received: from gavenkoa by 217.117.64.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Apr 2013 10:22:04 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik gmail.com> writes: > > On 25.4.2013, at 07:32, Oleksandr Gavenko 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...