help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Org Capture Template


From: daniela-spit
Subject: Re: Org Capture Template
Date: Fri, 27 Nov 2020 07:13:41 +0100


> Sent: Friday, November 27, 2020 at 6:53 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: daniela-spit@gmx.it
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Org Capture Template
>
> * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-11-27 07:47]:
> > I am writing an Org Capture Template.  But I want to use concat
> > to keep indentation.  But it is giving me "Invalid capture template".
> >
> > (setq org-capture-templates
> >
> >    '( ("t" "Todo" entry
> >          (file "~/02history/rcl.org")
> >          (concat "* TODO %^{Heading}\n  Brief: %^{Brief}\n"
> >                  "Detail: %?\n"
> >                  "Entered: %T\n  Link: %a\n") ))
>
> Probably because anything after quoted list is not evaluated.
>
> This '((+ 2 2)) will not be evaluated to '(4)
>
> To have `concat' evaluted you would need:
>
> (list  (list "t" "Todo" 'entry
>           '(file "~/02history/rcl.org")
>           (concat "* TODO %^{Heading}\n  Brief: %^{Brief}\n"
>                   "Detail: %?\n"
>                   "Entered: %T\n  Link: %a\n") ))
>
> As you see I would need to quote entry and list beginning with `file'
> not to get such evaluated to make concat work.
>
> And there is also no ensurance that program using customized variable
> will take it as list to be evaluated. It is better you do with with
> hand by using:
>
> "* TODO %^{Heading}\n  Brief: %^{Brief}\n"Detail: %?\nEntered: %T\nLink: %a\n"

Yes, it seems better to do  one long string, it was how I was doing things.
Afterwards, I thought that concat could help me to indent the string for cases
where it is too long.  Is there any other way to be able to indent, rather than
using column number 1, when starting a new line?





reply via email to

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