[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Alternate format for datetree

From: Ian Barton
Subject: Re: [O] Alternate format for datetree
Date: Thu, 06 Sep 2012 08:46:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 29/08/12 21:01, Ian Barton wrote:
On 29/08/12 15:25, John Hendy wrote:
On Wed, Aug 29, 2012 at 2:49 AM, Ian Barton <address@hidden> wrote:
On 28/08/12 13:50, Nick Dokos wrote:

Ian Barton <address@hidden> 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:

           (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"))))
    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---
            (file+headline "~/test.org"
                           ,(format "%s %s"
                                    (format-time-string "%B")
                                    (format-time-string "%Y"))))
--8<---------------cut here---------------end--------------->8---


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).

Thanks both. I'll try with a minimal emacs and post the results.
However, it may be a day or two as I am currently in the far West of
Ireland with very variable Internet connections

Now back with a reliable Internet connection. Thanks for the minimal example, which worked correctly. In my full setup, I have quite a lot of template definitions. It turned out that I had put the backquote the wrong side of a bracket.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]