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?

1 Answer 1

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.

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.