On 2016-09-21 12:54, Adam Porter wrote:
li...@wilkesley.net writes:

I have a capture template which prompts for a file name and uses this
to create a filename with a datestamp:

(defun capture-pelican-draft-file (path)
  (let ((name (read-string "Name: ")))
    (expand-file-name (format "%s-%s.org"
                              (format-time-string "%Y-%m-%d")
                              name) path)))


("g"
   "New blog post (ianbarton.net)"
   plain
   (file (capture-pelican-draft-file
"~/Documents/emacs/web_sites/ianbarton.net/org/_posts"))
   "#+AUTHOR: Ian Barton\n#+DATE: %u\n#+PROPERTY: MODIFIED:
\n#+TITLE\n#+CATEGORY: Blog \n#+PROPERTY: TAGS \n#+PROPERTY: SUMMARY
\n#+SETUPFILE: ../setup.org\n\n")

Are you using custom-set-variables to set org-capture-templates?  If
not, I think you need to unquote capture-pelican-draft-file.

On the current git master the function capture-pelican-draft-file
doesn't seem to be evaluated, resulting in a "File name doesn't exist"
error. Doing git bisect seems to point at the commit below:

8860c92f62dac87267416708e81bc8aec026fcc7 is the first bad commit
commit 8860c92f62dac87267416708e81bc8aec026fcc7
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Date:   Fri Jun 24 00:55:03 2016 +0200

That commit is about org-babel, which I don't think should have anything
to do with org-capture.  But you said you bisected it, so you mean that
before that commit, your code works as-is?

Thanks, I'll redo my bisect. I was being harassed by the dog, so might have made a mistake! However, the previous commit looks as though it might have been the one responsible:

commit 5485170263a46fa17db67b0324c4c4e48bcdfe49
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Date:   Fri Jun 24 01:11:49 2016 +0200

    org-capture: Remove forbidden value type from "file" templates

I'll try unquoting capture-pelican-draft-file.

Ian.

Reply via email to