From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Looking for a sample function to find a location for org-capture Date: Thu, 12 Aug 2010 16:37:53 +0200 Message-ID: <87eie3hp6m.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=35661 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OjYv0-0008MF-8F for emacs-orgmode@gnu.org; Thu, 12 Aug 2010 10:38:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OjYuq-0005PS-Bp for emacs-orgmode@gnu.org; Thu, 12 Aug 2010 10:38:00 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:50640) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OjYuq-0005PJ-6q for emacs-orgmode@gnu.org; Thu, 12 Aug 2010 10:37:56 -0400 Received: by wwi14 with SMTP id 14so168373wwi.30 for ; Thu, 12 Aug 2010 07:37:55 -0700 (PDT) In-Reply-To: (Charles Cave's message of "Thu, 12 Aug 2010 01:30:51 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Charles Cave Cc: emacs-orgmode@gnu.org Charles Cave 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