I face similar issue with
https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00676.html but for
plain text type.
Here is the example for capturing plain text:
1. echo -e "* Test Entry" > ~/test.org
2. Set org-capture-template as:
(setq org-capture-templates
`(("t" "Test"
plain
(function
(lambda ()
(set-buffer (org-capture-target-buffer "~/test.org"))
(goto-char (point-min))))
"Plain Text"
:immediate-finish t :jump-to-captured t)))
3. Type "C-c c t"
4. The result of "test.org" becomes:
Plain Text
* Test Entry
But what I wanted is:
* Test Entry
Plain Text
For capturing org entry:
1. echo -e "* Test Entry" > ~/test.org
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-min))))
"Plain Text"
:immediate-finish t :jump-to-captured t)))
3. Type "C-c c t"
4. The result of "test.org" becomes:
* Test Entry
** Plain Text
Currently, unlike `org-capture-place-entry', `org-capture-place-plain-text'
would ignore `:target-entry-p' when using function as target (because
`:exact-position' is set) in an org capture template.
Emacs : GNU Emacs 30.1 (build 1, aarch64-apple-darwin24.3.0, NS appkit-2575.40
Version 15.3.1 (Build 24D70))
of 2025-02-28
Package: Org mode version 9.8-pre (release_9.7.30-371-g5b419c @
/Users/wangtianshu/.config/emacs/straight/build/30.1/org/)
--
Tianshu Wang