emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Set tags in region


From: Alexander Baier
Subject: Re: [O] Set tags in region
Date: Sat, 10 May 2014 18:55:11 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

On 2014-05-10 16:14 John Hendy wrote:
> On May 9, 2014 11:21 PM, "Nick Dokos" <address@hidden> wrote:
>>
>> John Hendy <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]