From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: using org-global-properties in capture templates Date: Sun, 3 Dec 2017 14:53:43 +0200 Message-ID: References: <8760azy5mx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1145b9348603a8055f6f1734" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLTmF-0007yR-Ov for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 07:53:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLTmE-0004GH-4p for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 07:53:47 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:34770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLTmD-0004Ej-RP for emacs-orgmode@gnu.org; Sun, 03 Dec 2017 07:53:46 -0500 Received: by mail-wm0-x22c.google.com with SMTP id y82so11140237wmg.1 for ; Sun, 03 Dec 2017 04:53:45 -0800 (PST) In-Reply-To: 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: Adrian Bradd Cc: org mode , Nicolas Goaziou --001a1145b9348603a8055f6f1734 Content-Type: text/plain; charset="UTF-8" Hi thank you Adrian so so much, i hugely appreciate this! this works perfectly now, thx for pointing me in the right direction have a great week! Z On Sun, Dec 3, 2017 at 3:28 AM, Adrian Bradd wrote: > Hello, > > It looks like you have one too many parenthesis around the Rating entry. > org-global properties is supposed to be a list of cons cells. The below > should work: > > #+BEGIN_SRC elisp > (setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese > Asian Chinese Israeli Italian American EastEuro Mexican French Persian > Austrian Greek Fusion"))) > (add-to-list 'org-global-properties '("Rating_ALL". "- 1 2 3 4 5")) > #+END_SRC > > Below is a version that worked for me with all three properties. I declare > the properties all in one list instead of adding them. > > #+BEGIN_SRC elisp > (setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese > Asian Chinese Israeli Italian American EastEuro Mexican French Persian > Austrian Greek Fusion") ("Effort_ALL" . "0 0:10 0:20 0:30 1:00 2:00 3:00 > 4:00 6:00 8:00") ("Rating_ALL" . "- 1 2 3 4 5"))) > > (setq org-capture-templates > '(("f" "Food" > entry > (file+headline "~/tmp/tmp.org" "Inbox") > "* COOK %^{Recipe Name} > :PROPERTIES: > :ID: %(org-id-uuid) > :Time: %^{minutes|-|10|15|30|60} > :Effort: %^{Effort}p > :Rating: %^{Rating}p > :Cuisine: %^{Cuisine}p > :END: > " > "Capture Template for food recipe"))) > #+END_SRC > > HTH, > > Adrian > > On 22 November 2017 at 04:52, Xebar Saram wrote: > >> Hi all >> >> sorry to nudge but after spending alot of time on this , googling etc >> cant seem to get it to work. any help, tips or pointing me in the right >> direction would really be appreciated! >> >> Z >> >> On Sat, Nov 4, 2017 at 5:31 PM, Xebar Saram wrote: >> >>> sorry to bother again but still stuck with this.... >>> >>> i tried to add another org-global-property entry (i assume thats >>> possible) but then i didnt get completion for the second one. >>> this is what i used >>> >>> (setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese >>> Asian Chinese Israeli Italian American EastEuro Mexican French Persian >>> Austrian Greek Fusion"))) >>> (add-to-list 'org-global-properties '(("Rating_ALL". "- 1 2 3 4 5"))) >>> >>> can anyone point me to the correct syntax for adding additional >>> org-global-properties? >>> >>> thx alot in advance >>> >>> Z >>> >>> >>> On Sat, Oct 28, 2017 at 9:44 PM, Xebar Saram wrote: >>> >>>> thx so much >>>> >>>> that works well. i tried to add another org-global-property entry (i >>>> assume thats possible) but then i didnt get completion for the second one. >>>> this is what i used >>>> >>>> (setq org-global-properties '(("Cuisine_ALL". "- Indian Thai Vietnamese >>>> Asian Chinese Israeli Italian American EastEuro Mexican French Persian >>>> Austrian Greek Fusion"))) >>>> (add-to-list 'org-global-properties '(("Rating_ALL". "- 1 2 3 4 5"))) >>>> >>>> i assume my syntax is wrong? >>>> >>>> thx! >>>> >>>> Z >>>> >>>> On Sat, Oct 28, 2017 at 12:37 PM, Nicolas Goaziou < >>>> mail@nicolasgoaziou.fr> wrote: >>>> >>>>> Hello, >>>>> >>>>> Xebar Saram writes: >>>>> >>>>> > ;; Effort and global properties >>>>> > (setq org-global-properties '(("Effort_ALL". "0 0:10 0:20 0:30 1:00 >>>>> 2:00 >>>>> > 3:00 4:00 6:00 8:00"))) >>>>> > >>>>> > >>>>> > >>>>> > (add-to-list 'org-capture-templates >>>>> > '("f" "Food" >>>>> > entry >>>>> > (file+headline (lambda () (concat pmm "/org/files/agenda/food.org")) >>>>> > "Inbox") >>>>> > "* COOK %^{Recipe Name} >>>>> > :PROPERTIES: >>>>> > :ID: %(org-id-uuid) >>>>> > :Effort_ALL: %^{Effort_ALL}p >>>>> > :END: >>>>> > " >>>>> > "Capture Template for food recipe" >>>>> > )) >>>>> >>>>> "XYZ_ALL" is a special property defining allowed values for "XYZ". In >>>>> you case, you will get completion for "Effort" with: >>>>> >>>>> :Effort: %^{Effort}p >>>>> >>>>> >>>>> Regards, >>>>> >>>>> -- >>>>> Nicolas Goaziou >>>>> >>>> >>>> >>> >> > --001a1145b9348603a8055f6f1734 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

thank you Adrian so so much, i hugel= y appreciate this!

this works perfectly now, thx f= or pointing me in the right direction

have a great= week!

Z
On Sun, Dec 3, 2017 at 3:28 AM, Adrian Bradd <adrian.bradd@gmail.com> wrote:
Hello,

It looks like you have one too many pa= renthesis around the Rating entry. org-global properties is supposed to be a list of cons=20 cells. The below should work:

#+BEGIN_SRC elisp

(setq org-global-properties '(("Cuisine_ALL". "- Indian Thai = Vietnamese Asian Chinese Israeli Italian American EastEuro Mexican French Persian=20 Austrian Greek Fusion")))
(add-to-li= st 'org-global-properties '("Rating_ALL". "- 1 2 3 4= 5"))
#+END_SRC

Below is a version that worked for me with all three properties. I declare=20 the properties all in one list instead of adding them.

#+BEGIN_SRC e= lisp
(setq org-global-properties '(("Cuisine_ALL". "- Indian Thai = Vietnamese Asian Chinese Israeli Italian American EastEuro Mexican French Persian=20 Austrian Greek Fusion") ("Effort_ALL" . "0 0:10 0:20 0:= 30 1:00 2:00 3:00 4:00 6:00 8:00") ("Rating_ALL" . "- 1 2 3 4 5")))=

=C2=A0(setq org-capture-templates
=C2=A0 '(("f" &q= uot;Food"
=C2=A0=C2=A0=C2=A0 entry
=C2=A0=C2=A0=C2=A0 (fi= le+headline=C2=A0 "~/tmp/= tmp.org" "Inbox")
=C2=A0=C2=A0=C2=A0 "* COOK %^{Recipe Name}= =C2=A0=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 :PROPERTIES:
=C2=A0=C2= =A0=C2=A0 :ID: %(org-id-uuid)
=C2=A0=C2=A0=C2=A0 :Time: %^{minutes|-|1= 0|15|30|60}
=C2=A0=C2=A0=C2=A0 :Effort: %= ^{Effort}p
=C2=A0=C2=A0=C2=A0 :Rating: %^{Rating}p
=C2=A0=C2= =A0=C2=A0 :Cuisine: %^{Cuisine}p
=C2=A0=C2=A0=C2=A0 :END:
=C2=A0=C2= =A0=C2=A0 "
=C2=A0=C2=A0=C2=A0 "Capture Templ= ate for food recipe")))
#+END_SRC

HTH,

Adrian
<= /div>

On 22 November 2017 at 04:52, Xebar Saram <= zeltakc@gmail.com> wrote:
Hi all

sorry to nudge but afte= r spending alot of time on this , googling etc cant seem to get it to work.= any help, tips or pointing me in the right direction would really be appre= ciated!

Z

On Sat, = Nov 4, 2017 at 5:31 PM, Xebar Saram <zeltakc@gmail.com> wrot= e:
sorry to bother again= but still stuck with this....

i tried to add anot= her org-global-property entry (i assume thats possible) but then i didnt ge= t completion for the second one.
this is what i used

(setq org-global-properties '(("Cuisine_ALL". "- = Indian Thai Vietnamese Asian Chinese Israeli Italian American EastEuro Mexi= can French Persian Austrian Greek Fusion")))
(add-to-list &#= 39;org-global-properties '(("Rating_ALL". "- 1 2 3 4 5&q= uot;)))

can anyone point me to the correct = syntax for adding additional org-global-properties?

thx alot in advance

Z

=

On Sa= t, Oct 28, 2017 at 9:44 PM, Xebar Saram <zeltakc@gmail.com> = wrote:
thx so much

=
that works well. i tried to add another org-global-property entr= y (i assume thats possible) but then i didnt get completion for the second = one.
this is what i used

(setq org-= global-properties '(("Cuisine_ALL". "- Indian Thai Vietn= amese Asian Chinese Israeli Italian American EastEuro Mexican French Persia= n Austrian Greek Fusion")))
(add-to-list 'org-global-pro= perties '(("Rating_ALL". "- 1 2 3 4 5")))

i assume my syntax is wrong?

thx!

Z

On Sat, Oct 28, 2017 at 12:37 = PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
=
Hello,

Xebar Saram <zelt= akc@gmail.com> writes:

> ;; Effort and global properties
> (setq org-global-properties '(("Effort_ALL". "0 0:1= 0 0:20 0:30 1:00 2:00
> 3:00 4:00 6:00 8:00")))
>
>
>
> (add-to-list 'org-capture-templates
> '("f" "Food"
> entry
> (file+headline (lambda () (concat pmm "/org/files/agenda/food.org"= ;))
> "Inbox")
> "* COOK %^{Recipe Name}
> :PROPERTIES:
> :ID: %(org-id-uuid)
> :Effort_ALL: %^{Effort_ALL}p
> :END:
> "
> "Capture Template for food recipe"
> ))

"XYZ_ALL" is a special property defining allowed values fo= r "XYZ". In
you case, you will get completion for "Effort" with:

=C2=A0 :Effort: %^{Effort}p


Regards,

--
Nicolas Goaziou





--001a1145b9348603a8055f6f1734--