From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-capture with function type target Date: Tue, 26 Nov 2013 06:29:02 +0100 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlBCi-0000XA-UR for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 00:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlBCd-00069I-FR for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 00:28:56 -0500 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:62260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlBCd-00069E-8m for emacs-orgmode@gnu.org; Tue, 26 Nov 2013 00:28:51 -0500 Received: by mail-wg0-f47.google.com with SMTP id n12so3789691wgh.14 for ; Mon, 25 Nov 2013 21:28:50 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: York Zhao Cc: emacs-orgmode Hi York, I have applied your patch. Thank you! - Carsten On 18.11.2013, at 02:32, York Zhao wrote: > To whom it may concern, >=20 > Please find attached my patch to address this issue. Please let me > know if the patch is acceptable. >=20 > Thanks, >=20 > York >=20 >=20 > On Sat, Nov 16, 2013 at 8:13 PM, York Zhao = wrote: >> Hi list, >>=20 >> I'm been so frustrated when trying to use function as `target' in an >> org-capture' template, here is my example: >>=20 >> 1. Create a file "~/test.org" and add a line "* Level 1", make sure = to add a >> newline character after the inserted line >> 2. Set org-capture-template as: >> (setq org-capture-templates >> `(("t" >> "Test" >> entry >> (function >> (lambda () >> (set-buffer (org-capture-target-buffer "~/test.org")) >> (goto-char (point-max)))) >> "* Level 2" >> :immediate-finish t))) >> 3. Type "C-c c t" >> 4. The result of "test.org" becomes: >>=20 >> * Level 1 >> * Level 2 >>=20 >> But what I wanted is: >>=20 >> * Level 1 >> ** Level 2 >>=20 >> I looked into "org-capture.el" and figured out that it is because = when >> `:exact-position' is set, function `org-capture-place-entry' never = insert >> template as a child of current entry. And `:exact-position' is set = when Target >> is a function. >>=20 >> I don't understand why it is designed this way, does it have to be = this way? >> what can I do if I want to insert "Level 2" as a child of "Level 1" = while using >> a function as template target? >>=20 >>=20 >> Thanks, >>=20 >> York > <0001-org-capture-place-entry-Do-not-special-casing-for-ex.patch>