From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: Re: Set tags in region Date: Sat, 10 May 2014 18:55:11 +0200 Message-ID: <87r4413768.fsf@mailbox.org> References: <87ha4yl0xm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjAZg-0002bS-Gu for emacs-orgmode@gnu.org; Sat, 10 May 2014 12:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjAZa-0008Mp-8K for emacs-orgmode@gnu.org; Sat, 10 May 2014 12:56:36 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:50876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjAZa-0008Ml-1M for emacs-orgmode@gnu.org; Sat, 10 May 2014 12:56:30 -0400 In-Reply-To: (John Hendy's message of "Sat, 10 May 2014 09:14:49 -0500") 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: John Hendy Cc: Nick Dokos , emacs-orgmode On 2014-05-10 16:14 John Hendy wrote: > On May 9, 2014 11:21 PM, "Nick Dokos" wrote: >> >> John Hendy writes: >> >> > Hello, >> > >> > >> > Just curious of there's a way to set the tags in a region all at once? >> >> (org-map-entries (function org-set-tags) nil 'region) >> >> or >> >> (org-map-entries (lambda () (org-set-tags-to '(foo))) nil 'region) >> >> or some variation thereof. >> > > I did see that function, but it didn't DUI what I expected with M-x. Would > u need to run it as above or could I use M-x with it somehow? > > A above I take it I'd put that in the buffer and then eval-region? If you want to call this interactively, i.e. via M-x or a key-binding, you will have to wrap this code in a defun with an interactive from and thus turn it into a command. Like this: #+BEGIN_SRC emacs-lisp (defun my-set-tag-in-region () (interactive) (org-map-entries (function org-set-tags) nil 'region)) #+END_SRC HTH, -- Alexander Baier