emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bastien.guerry@wikimedia.fr>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: Call org-map-entries just on children?
Date: Tue, 08 Feb 2011 16:43:55 +0100	[thread overview]
Message-ID: <878vxqbkg4.fsf@gnu.org> (raw)
In-Reply-To: <87ipwvd97b.fsf@berkeley.edu> (Richard Lawrence's message of "Mon, 07 Feb 2011 09:51:36 -0800")

Hi Richard,

Richard Lawrence <richard.lawrence@berkeley.edu> writes:

> I want to call org-map-entries in a way that calls a function at each
> *child* of the current tree, but not at the current tree itself.  That
> is, for some function f, if my Org file looks like this:
>
> * Paper 1
> ** Student 1
> ** Student 2
> ...
>
> I want to call f at "Student 1", "Student 2", etc. but not at "Paper 1".
> But if point is positioned at "Paper 1", then
>
> (org-map-entries 'f nil 'tree)
>
> first calls f at the "Paper 1" entry, not the "Student 1" entry.  How
> can I apply f just to the *children* of "Paper 1"?

You can simply add 

  (setq org-map-continue-from (outline-next-heading))

at the very beginning of your `f' function.

HTH,

-- 
 Bastien

  reply	other threads:[~2011-02-08 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 17:51 Call org-map-entries just on children? Richard Lawrence
2011-02-08 15:43 ` Bastien [this message]
2011-02-08 18:52   ` Richard Lawrence

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=878vxqbkg4.fsf@gnu.org \
    --to=bastien.guerry@wikimedia.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lawrence@berkeley.edu \
    /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).