0

I'm trying to set up a capture that automatically deactivates the undo-tree history saving in an encrypted file by setting file local variables. When I call the capture and have entered the filename the following error happens:

error("Capture template `%s': %s" "E" "Template is not a valid Org entry or tree")

(setq org-capture-templates
      '(("E" "Encrypted File" entry (file my-org-capture-ask-for-filename)
                                 "-*- undo-tree-auto-save-history: nil; epa-file-encrypt-to: nil; -*-

* %i%?")))

The error disappears once I remove the file variables:

(setq org-capture-templates
      '(("E" "Encrypted File" entry (file my-org-capture-ask-for-filename)
                                 "* %i%?")))

Do I have to escape the file variable line somehow?

1 Answer 1

1

Okay, I figured it out. I had to specify "plain" instead of "entry" as type, otherwise org-capture expects an org mode node, with a headline:

(setq org-capture-templates
      '(("E" "Encrypted File" plain (file my-org-capture-ask-for-filename)
                                 "-*- undo-tree-auto-save-history: nil; epa-file-encrypt-to: nil; -*-

* %i%?")))

Your Answer

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

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