On Wed, Aug 29, 2012 at 2:49 AM, Ian Barton <li...@manor-farm.org> wrote:
> On 28/08/12 13:50, Nick Dokos wrote:
>>
>> Ian Barton <li...@wilkesley.net> wrote:
>>
>>> I would like to use something like this. However, using a recent git
>>> checkout of org mode and the following simple template from the
>>> original list message:
>>>
>>> ("u"
>>>           "Test"
>>>           entry
>>>           (file+headline "~/test.org"
>>>                          ,(format "%s %s"
>>>                                   (format-time-string "%B")
>>>                                   (format-time-string "%Y"))))
>>> I get the following error:
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp (\, (format
>>> "%s %s" (format-time-string "%B") (format-time-string "%Y"))))
>>>    regexp-quote((\, (format "%s %s" (format-time-string "%B")
>>> (format-time-string "%Y"))))
>>>    org-capture-set-target-location()
>>>    org-capture(nil)
>>>    call-interactively(org-capture nil nil)
>>>
>>> I also get the same error from John Hendy's template. Is this a bug in
>>> recent versions of org, or is there an error in the template lisp? I
>>> have tried doing a git bisect, but can only go back a few commits, as
>>> my config now includes  several things that have only recently been
>>> added to org.
>>>
>>
>> You are missing the backquote:
>>
>> --8<---------------cut here---------------start------------->8---
>>   `("u"
>>            "Test"
>>            entry
>>            (file+headline "~/test.org"
>>                           ,(format "%s %s"
>>                                    (format-time-string "%B")
>>                                    (format-time-string "%Y"))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> Nick
>>
> Thanks Nick. Hwever with the following minimal template, from the OP, I
> still get the error:
>
> ;; org-capture settings.
> (setq org-capture-templates
> `(("t" "test" entry
> (file+headline "~/file.org"
> ,(format "%s"
> (format-time-string "%m")))
> ,(format "** %s \n*** %s-%s \n**** [%s-%s-%s %s %s:%s] "
> (format-time-string "%d")
> (format-time-string "%Y")
> (format-time-string "%A")
> (format-time-string "%Y")
> (format-time-string "%m")
> (format-time-string "%d")
> (format-time-string "%a")
> (format-time-string "%H")
> (format-time-string "%M"))
> )))

Odd. I just copied and pasted this into my .emacs and commented out my
actual capture templates section entirely, leaving only this and it
works as expected.

(Just saw Nick's response as well and was going to both try and
suggest similar with a minimal .emacs).


John

>
> Ian.
>

Reply via email to