emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bastien.guerry@wikimedia.fr>
To: Charles Cave <charles_cave@optusnet.com.au>
Cc: emacs-orgmode@gnu.org
Subject: Re: Looking for a sample function to find a location for org-capture
Date: Thu, 12 Aug 2010 16:37:53 +0200	[thread overview]
Message-ID: <87eie3hp6m.fsf@gnu.org> (raw)
In-Reply-To: <loom.20100812T032601-189@post.gmane.org> (Charles Cave's message of "Thu, 12 Aug 2010 01:30:51 +0000 (UTC)")

Charles Cave <charles_cave@optusnet.com.au> writes:

> I'm exploring the many features of org-capture and I see the
> documentation about a function for finding the location for refiling.

Let's say you have this capture template:

,----
| (setq org-capture-templates
|   '(("w" "WP TEST" entry (function bzg-find-location)
|      "* TODO Put this after abcde\n\n" :prepend t)))
`----

And this finding function:

,----
| (defun bzg-find-location ()
|   "Example: find my bzg.org file and the abcde string in the current buffer"
|   (find-file "~/org/bzg.org")
|   (goto-char (point-min))
|   (re-search-forward "abcde" nil t)
|   (newline 2))
`----

Capturing with "w" will put the entry after the "abcde" string in
bzg.org.

HTH,

-- 
 Bastien

  parent reply	other threads:[~2010-08-12 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  1:30 Looking for a sample function to find a location for org-capture Charles Cave
2010-08-12 10:06 ` Carsten Dominik
2010-08-12 11:42   ` Nick Dokos
2010-08-12 14:37 ` Bastien [this message]
2010-08-12 23:11   ` Charles Cave

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=87eie3hp6m.fsf@gnu.org \
    --to=bastien.guerry@wikimedia.fr \
    --cc=charles_cave@optusnet.com.au \
    --cc=emacs-orgmode@gnu.org \
    /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).