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 11:06:05 +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]:56599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVK0N-0005R6-Ga for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 07:06:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVK0M-0001qu-CJ for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 07:06:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:60166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVK0M-0001qk-5G for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 07:06:22 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UVK0F-0004Hi-U9 for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 13:06:16 +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 13:06:15 +0200 Received: from gavenkoa by 217.117.64.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Apr 2013 13:06:15 +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 apr. 2013, at 10:56, Oleksandr Gavenko gmail.com> wrote: > > > > (defun my-org-kill-by-tag (tag) > > (interactive (list (completing-read "Enter tag: " (org-get-buffer-tags)))) > > (kill-new "") > > (org-scan-tags > > (lambda () > > (let ( (last-command 'kill-region) ) > > (org-cut-subtree))) > > '(member tag tags-list) > > nil) ) > > > > Is it possible to include "correct" implementation (seems that I can't able > > implement one) to org-mode? > > I thought your version did work? Does it not? > Yes. It works. But implementation relay on internals of 'org-cut-subtree' and applied only to single file and without any checks (I try call on non-org buffer - it doesn't do anything - so seems it is safe). Also it doesn't follow any org-mode coding conventions... Also 'org-scan-tags' have 'todo-only' argument which may be interesting for possible users of my-org-kill-by-tag.... > > I want this feature in order to simplify precess of moving entries from job > > org-file to home org-file by marking entries with tag :HOME:...