From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: org capture properties from a list of strings? Date: Tue, 25 Apr 2017 18:56:37 +0300 Message-ID: References: <87y3uozzlm.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045fe1b4d6259a054dffc422 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d32pU-0004zo-EI for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 11:56:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d32pT-0001uo-9b for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 11:56:40 -0400 Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]:33463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d32pS-0001ub-VB for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 11:56:39 -0400 Received: by mail-pg0-x234.google.com with SMTP id 63so30585786pgh.0 for ; Tue, 25 Apr 2017 08:56:38 -0700 (PDT) In-Reply-To: <87y3uozzlm.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: org mode --f403045fe1b4d6259a054dffc422 Content-Type: text/plain; charset=UTF-8 thx Nicolas really appreciate your answer! though im very week in coding so im struggling to understand. but perhaps an example will help. the following is a part of my capture: (add-to-list 'org-capture-templates '("ff" "Food" entry (file+headline (concat pmm "/org/files/agenda/food.org") "Inbox") "* COOK %^{Recipe Name} :PROPERTIES: :ID: %(org-id-uuid) :Time: %^{minutes|-|10|15|30|60} :Rating: %^{rating?|-|1|2|3|4|5} :Source: %x :Cuisine: %^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian} :Type: %^{Type?|-|main|side|starter|sweets|drinks|sauce|breakfast} :Main.ing: %^{main.ing?|-|chicken|beef|potatos|fish|seafood|shrimp|rice|pasta|fruit} :Serves: %^{Serves?|-|1|2|4|6|8} :END: %^{prompt|*** Ingredients} %? %^{prompt|*** Preparation} " "Capture Template for food recipe" )) so do i need a separate mapconcat #'number-to-string for each property value (time,type etc?) and how dows the %s know which mapconcat command to refer to? thx alot again Z On Tue, Apr 25, 2017 at 11:00 AM, Nicolas Goaziou wrote: > Hello, > > Xebar Saram writes: > > > kinda stuck with this and cant find any documentation. would also be glad > > to know its not possible so i can perhaps explore another method :) > > > > im basically wondering if instead of manually imputing string separated > > with | in the : %^{} capture template i can provide a lisp way to send a > > pre defined list of strings ("a" "b" "c") etc.. anyone has any clue? > > Since it is pre-defined, you can do the following during capture > definition > > (format "* Headline > :PROPERTIES: > :Time: %%^{minutes|-|%s} > :Rating: %%^{rating?|-|%s} > :END:" > (mapconcat #'number-to-string '(10 15 30 60) "|") > (mapconcat #'number-to-string '(1 2 3 4 5) "|")) > > Can't you? > > Regards, > > -- > Nicolas Goaziou > --f403045fe1b4d6259a054dffc422 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thx Nicolas

really appreciate your answ= er! though im very week in coding so im struggling to understand. but perha= ps an example will help. the following is a part of my capture:
<= br>
(add-to-list 'org-capture-templates
'(= "ff" "Food"
entry
(file+headline (c= oncat pmm "/org/files/agenda/food.org&= quot;) "Inbox")
"* COOK %^{Recipe Name} =C2=A0 =C2= =A0 =C2=A0
:PROPERTIES:
:ID: %(org-id-uuid)
:= Time: %^{minutes|-|10|15|30|60}
:Rating: %^{rating?|-|1|2|3|4|5}<= /div>
:Source: =C2=A0%x=C2=A0
:Cuisine: %^{Cuisine?|-|Indian|= Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|Fre= nch|Persian|Austrian}
:Type: %^{Type?|-|main|side|starter|sweets|= drinks|sauce|breakfast}
:Main.ing: =C2=A0%^{main.ing?|-|chicken|b= eef|potatos|fish|seafood|shrimp|rice|pasta|fruit}
:Serves: %^{Ser= ves?|-|1|2|4|6|8}
:END:

%^{prompt|*** In= gredients}
%?
%^{prompt|*** Preparation}

=
"
"Capture Template for food recipe"
))


so do i need a sep= arate=C2=A0=C2=A0mapconcat #'number-to= -string for each property value (time,type etc?)

and how dows the %s know which mapconcat command to refer to?

thx alot again=

Z


On Tue, Apr 25, 2017 at 11= :00 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:=
Hello,

Xebar Saram <zeltakc@gmail.com&= gt; writes:

> kinda stuck with this and cant find any documentation. would also be g= lad
> to know its not possible so i can perhaps explore another method :) >
> im basically wondering if instead of manually imputing string separate= d
> with | in the=C2=A0 : %^{} capture template i can provide a lisp way t= o send a
> pre defined list of strings ("a" "b" "c"= ) etc.. anyone has any clue?

Since it is pre-defined, you can do the following during capture
definition

=C2=A0 (format "* Headline
=C2=A0 :PROPERTIES:
=C2=A0 :Time: %%^{minutes|-|%s}
=C2=A0 :Rating: %%^{rating?|-|%s}
=C2=A0 :END:"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapconcat #'number-to-string '(= 10 15 30 60) "|")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapconcat #'number-to-string '(= 1 2 3 4 5) "|"))

Can't you?

Regards,

--
Nicolas Goaziou

--f403045fe1b4d6259a054dffc422--