From: Carsten Dominik <carsten.dominik@gmail.com>
To: York Zhao <gtdplatform@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-capture with function type target
Date: Tue, 26 Nov 2013 06:29:02 +0100 [thread overview]
Message-ID: <B18EF071-64FC-4F54-AA88-D5A81EA032DB@gmail.com> (raw)
In-Reply-To: <CAD3zm22HZ4j1iLk2F_9EDc8KOCVBUQ-g-G4FB4V0iorcTvckEA@mail.gmail.com>
Hi York,
I have applied your patch. Thank you!
- Carsten
On 18.11.2013, at 02:32, York Zhao <gtdplatform@gmail.com> wrote:
> To whom it may concern,
>
> Please find attached my patch to address this issue. Please let me
> know if the patch is acceptable.
>
> Thanks,
>
> York
>
>
> On Sat, Nov 16, 2013 at 8:13 PM, York Zhao <gtdplatform@gmail.com> wrote:
>> Hi list,
>>
>> I'm been so frustrated when trying to use function as `target' in an
>> org-capture' template, here is my example:
>>
>> 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:
>>
>> * Level 1
>> * Level 2
>>
>> But what I wanted is:
>>
>> * Level 1
>> ** Level 2
>>
>> 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.
>>
>> 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?
>>
>>
>> Thanks,
>>
>> York
> <0001-org-capture-place-entry-Do-not-special-casing-for-ex.patch>
next prev parent reply other threads:[~2013-11-26 5:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-17 1:13 org-capture with function type target York Zhao
2013-11-18 1:32 ` York Zhao
2013-11-26 5:29 ` Carsten Dominik [this message]
2013-11-27 2:29 ` York Zhao
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=B18EF071-64FC-4F54-AA88-D5A81EA032DB@gmail.com \
--to=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=gtdplatform@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).