3

One of my org capture templates (in my init.el) looks like the following:

("n" "Note" plain
           (file "/path/to/file.org")
           "* %^{Title} %U \n%? \n"
           :prepend t)

I'd like to see the following after I capture a note using this template:

#+TITLE: Notes
#+DESCRIPTION: a file of notes


* captured note [2019-10-14 Mon 18:06] 
* test note 2 [2019-10-14 Mon 13:00]
* test note 1 [2019-10-14 Mon 10:37]...

But what I actually get is:

* captured note [2019-10-14 Mon 18:06] 

#+TITLE: Notes
#+DESCRIPTION: a file of notes


* test note 2 [2019-10-14 Mon 13:00]
* test note 1 [2019-10-14 Mon 10:37]...

The "prepend" property almost does what I want - it prepends the headline to the beginning of the file, rather than the end. However, I'd like the header to stay at the top of the file.

Is there a way to prepend new headlines after the initial "#+" lines?

1 Answer 1

3

Change plain to entry.

See org manual template elements:

type
     The type of entry, a symbol.  Valid values are:

     ‘entry’
          An Org mode node, with a headline.  Will be filed as the child
          of the target entry or as a top-level entry.  The target file
          should be an Org file.

     ...

     ‘plain’
          Text to be inserted as it is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.