emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alexander Baier <alexander.baier@mailbox.org>
To: John Hendy <jw.hendy@gmail.com>
Cc: Nick Dokos <ndokos@gmail.com>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Set tags in region
Date: Sat, 10 May 2014 18:55:11 +0200	[thread overview]
Message-ID: <87r4413768.fsf@mailbox.org> (raw)
In-Reply-To: <CA+M2ft9u83ALaY14Sy_BtkKEA_a7AOohiOnMG8O_qvBZGXNZyQ@mail.gmail.com> (John Hendy's message of "Sat, 10 May 2014 09:14:49 -0500")

On 2014-05-10 16:14 John Hendy wrote:
> On May 9, 2014 11:21 PM, "Nick Dokos" <ndokos@gmail.com> wrote:
>>
>> John Hendy <jw.hendy@gmail.com> 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	other threads:[~2014-05-10 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-10  2:53 Set tags in region John Hendy
2014-05-10  4:20 ` Nick Dokos
2014-05-10 14:14   ` John Hendy
2014-05-10 16:55     ` Alexander Baier [this message]
2014-05-10  9:08 ` Alexander Baier
2014-05-21  2:29   ` Bastien
2014-05-10 11:00 ` Alexander Baier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4413768.fsf@mailbox.org \
    --to=alexander.baier@mailbox.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    --cc=ndokos@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).