4

I have an org-formatted file named foo.org that consists only of headings (without body). Notice the absence of blank lines.

* one
** a
** b
* two
** c
* three

I want to use capture templates to add a sub-headings (without body) under the top-level headings one or two while preserving the original format. To do this I have these templates

(setq org-capture-templates
  (list
    '("f" "Foo")
    '("fo" "One" entry
       (file+headline "/tmp/foo.org" "one")
       "** TODO %?"
       :prepend t :unnarrowed t :jump-to-captured t)
    '("ft" "Two" entry
       (file+headline "/tmp/foo.org" "two")
       "** TODO %?"
       :prepend t :unnarrowed t :jump-to-captured t)))

The problem is the templates automatically include a blank line after the heading

**␣TODO␣

which I have to delete manually every time. Is it possible to tell Emacs not to insert a newline character after the heading?

Ernest A
  • 461
  • 3
  • 10

1 Answers1

2

Try adding :empty-lines 0 to each template's set of properties. Zero is in fact the default value, so it would be strange if this was the solution, but maybe worth a try.

Phil Hudson
  • 1,651
  • 10
  • 13