From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bradd Subject: Re: using org-global-properties in capture templates Date: Sat, 2 Dec 2017 20:28:50 -0500 Message-ID: References: <8760azy5mx.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1a373c26aad7055f6586c7" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLJ5S-0000It-5C for emacs-orgmode@gnu.org; Sat, 02 Dec 2017 20:28:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLJ5Q-0002Eu-JY for emacs-orgmode@gnu.org; Sat, 02 Dec 2017 20:28:54 -0500 Received: from mail-pl0-x22e.google.com ([2607:f8b0:400e:c01::22e]:34062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLJ5Q-0002Eg-9X for emacs-orgmode@gnu.org; Sat, 02 Dec 2017 20:28:52 -0500 Received: by mail-pl0-x22e.google.com with SMTP id d21so8390053pll.1 for ; Sat, 02 Dec 2017 17:28:51 -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: Xebar Saram Cc: org mode , Nicolas Goaziou --94eb2c1a373c26aad7055f6586c7 Content-Type: text/plain; charset="UTF-8" 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 >>>> >>> >>> >> > --94eb2c1a373c26aad7055f6586c7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hel= lo,

It looks like you have one too many parenthesis 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-list 'org-global-prope= rties '("Rating_ALL". "- 1 2 3 4 5"))
#+END_SRC<= br>
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 (file+head= line=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|-|10|15|30|60}=C2=A0=C2=A0=C2=A0 :Effort: %^{Effort}p
=C2=A0=C2=A0=C2=A0 :Rat= ing: %^{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 "Ca= pture Template for food recipe")))
#+END_SRC

HTH,

Adr= ian

On= 22 November 2017 at 04:52, Xebar Saram <zeltakc@gmail.com> = 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 <zeltakc@gmail.com><= /span> wrote:
sorry to b= other 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 Ea= stEuro Mexican French Persian Austrian Greek Fusion")))
(add= -to-list 'org-global-properties '(("Rating_ALL". "- = 1 2 3 4 5")))

can anyone point me to t= he correct syntax for adding additional org-global-properties?
thx alot in advance

Z

<= /div>

= On Sat, Oct 28, 2017 at 9:44 PM, Xebar Saram <zeltakc@gmail.com&= gt; wrote:
thx so much

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

(setq org-global-pro= perties '(("Cuisine_ALL". "- Indian Thai Vietnamese Asia= n Chinese Israeli Italian American EastEuro Mexican French Persian Austrian= Greek Fusion")))
(add-to-list 'org-global-properties &#= 39;(("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




--94eb2c1a373c26aad7055f6586c7--