emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Capture template creates multiple property drawers, help needed
@ 2016-10-01  8:51 Xebar Saram
  2016-10-01 10:26 ` Philip Hudson
  0 siblings, 1 reply; 6+ messages in thread
From: Xebar Saram @ 2016-10-01  8:51 UTC (permalink / raw)
  To: org mode

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

Hi all

so i have this useful to me capture template

(add-to-list 'org-capture-templates
                   '("un" "resturant"
                     entry
                    (file+headline "/home/zeltak/org/files/agenda/travel.org"
"NYC")
    "* TOVISIT %^{Description}
    %u
  :PROPERTIES:
      :Rating: %^{rating?|-|1|2|3|4|5}
      :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
      :Source: %^{Source?}
      :Type: %^{Type?|meal|breakfeast|dessert|street}
      :Cuisine:
%^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}
      :Fav: %^{Fav|-|yes|no}
      :END:
    %?
        "
           ))


as you can see im constructing a capture template that will add a propery
drawer. i must be doping something wrong in my syntax as after a while when
other input are added to the created header down the road (org-id, date
etc) these create another property drawer. this looks like this

**** TOVISIT Ample hill ice cream
     :PROPERTIES:
     :ID:       06a84670-baa9-4925-be93-b18252d6b684
     :END:
       [2016-10-01 Sat]
     :PROPERTIES:
:Rating: -
:price: 0-10
:Source: http://www.amplehills.com/
:Type: dessert
:Cuisine: American
:Fav:
:END:

is there anyway to solve this issue? is my capture syntax wrong?

best

Z

[-- Attachment #2: Type: text/html, Size: 2593 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Capture template creates multiple property drawers, help needed
  2016-10-01  8:51 Capture template creates multiple property drawers, help needed Xebar Saram
@ 2016-10-01 10:26 ` Philip Hudson
  2016-10-01 11:05   ` Xebar Saram
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Hudson @ 2016-10-01 10:26 UTC (permalink / raw)
  To: Xebar Saram; +Cc: emacs orgmode-mailinglist

You need to put the timestamp (%u) /after/ the drawer in the template.

On 01/10/2016, Xebar Saram <zeltakc@gmail.com> wrote:
> Hi all
>
> so i have this useful to me capture template
>
> (add-to-list 'org-capture-templates
>                    '("un" "resturant"
>                      entry
>                     (file+headline
> "/home/zeltak/org/files/agenda/travel.org"
> "NYC")
>     "* TOVISIT %^{Description}
>     %u
>   :PROPERTIES:
>       :Rating: %^{rating?|-|1|2|3|4|5}
>       :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
>       :Source: %^{Source?}
>       :Type: %^{Type?|meal|breakfeast|dessert|street}
>       :Cuisine:
> %^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}
>       :Fav: %^{Fav|-|yes|no}
>       :END:
>     %?
>         "
>            ))
>
>
> as you can see im constructing a capture template that will add a propery
> drawer. i must be doping something wrong in my syntax as after a while when
> other input are added to the created header down the road (org-id, date
> etc) these create another property drawer. this looks like this
>
> **** TOVISIT Ample hill ice cream
>      :PROPERTIES:
>      :ID:       06a84670-baa9-4925-be93-b18252d6b684
>      :END:
>        [2016-10-01 Sat]
>      :PROPERTIES:
> :Rating: -
> :price: 0-10
> :Source: http://www.amplehills.com/
> :Type: dessert
> :Cuisine: American
> :Fav:
> :END:
>
> is there anyway to solve this issue? is my capture syntax wrong?
>
> best
>
> Z
>


-- 
phil.hudson@iname.com                      PGP/GnuPG ID: 0x887DCA63

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Capture template creates multiple property drawers, help needed
  2016-10-01 10:26 ` Philip Hudson
@ 2016-10-01 11:05   ` Xebar Saram
  2016-10-01 13:25     ` Philip Hudson
  0 siblings, 1 reply; 6+ messages in thread
From: Xebar Saram @ 2016-10-01 11:05 UTC (permalink / raw)
  To: Philip Hudson; +Cc: emacs orgmode-mailinglist

[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]

got it thx Phillip, appreciate it!

in a related continued issue, how does one define a sub header in the
capture that will translate correctly to a lower level header than the main
orc capture?

i have tried both this inside a capture:

  %^{prompt|*** Ingredients}


and also just using 2 stars

** sub header

yet none of them create a sub header. any clue guys?

Z



On Sat, Oct 1, 2016 at 1:26 PM, Philip Hudson <phil.hudson@iname.com> wrote:

> You need to put the timestamp (%u) /after/ the drawer in the template.
>
> On 01/10/2016, Xebar Saram <zeltakc@gmail.com> wrote:
> > Hi all
> >
> > so i have this useful to me capture template
> >
> > (add-to-list 'org-capture-templates
> >                    '("un" "resturant"
> >                      entry
> >                     (file+headline
> > "/home/zeltak/org/files/agenda/travel.org"
> > "NYC")
> >     "* TOVISIT %^{Description}
> >     %u
> >   :PROPERTIES:
> >       :Rating: %^{rating?|-|1|2|3|4|5}
> >       :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
> >       :Source: %^{Source?}
> >       :Type: %^{Type?|meal|breakfeast|dessert|street}
> >       :Cuisine:
> > %^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|
> Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}
> >       :Fav: %^{Fav|-|yes|no}
> >       :END:
> >     %?
> >         "
> >            ))
> >
> >
> > as you can see im constructing a capture template that will add a propery
> > drawer. i must be doping something wrong in my syntax as after a while
> when
> > other input are added to the created header down the road (org-id, date
> > etc) these create another property drawer. this looks like this
> >
> > **** TOVISIT Ample hill ice cream
> >      :PROPERTIES:
> >      :ID:       06a84670-baa9-4925-be93-b18252d6b684
> >      :END:
> >        [2016-10-01 Sat]
> >      :PROPERTIES:
> > :Rating: -
> > :price: 0-10
> > :Source: http://www.amplehills.com/
> > :Type: dessert
> > :Cuisine: American
> > :Fav:
> > :END:
> >
> > is there anyway to solve this issue? is my capture syntax wrong?
> >
> > best
> >
> > Z
> >
>
>
> --
> phil.hudson@iname.com                      PGP/GnuPG ID: 0x887DCA63
>

[-- Attachment #2: Type: text/html, Size: 3572 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Capture template creates multiple property drawers, help needed
  2016-10-01 11:05   ` Xebar Saram
@ 2016-10-01 13:25     ` Philip Hudson
  2016-10-01 15:55       ` Xebar Saram
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Hudson @ 2016-10-01 13:25 UTC (permalink / raw)
  To: Xebar Saram; +Cc: emacs orgmode-mailinglist

Your target location defines how many stars you need at the top-level
of your capture template. Each successive level of sub-heading then
starts on its own line with one more leading star, just the same as
anywhere else in org-mode.

I use a certain capture template for a type of task with required
subtasks. That template could be massively simplified as:

  ** TODO Finalize %?%^{item}
     SCHEDULED: <%(my-next-next-working-day)>
  *** TODO Process %\1
     SCHEDULED: <%(my-next-working-day)>
  **** TODO Prepare %\1
       SCHEDULED: %t

WFM with target heading "* Captures" in file "Todo.org"


On 1 October 2016 at 12:05, Xebar Saram <zeltakc@gmail.com> wrote:
> got it thx Phillip, appreciate it!
>
> in a related continued issue, how does one define a sub header in the
> capture that will translate correctly to a lower level header than the main
> orc capture?
>
> i have tried both this inside a capture:
>
>   %^{prompt|*** Ingredients}
>
>
> and also just using 2 stars
>
> ** sub header
>
> yet none of them create a sub header. any clue guys?
>
> Z
>
>
>
> On Sat, Oct 1, 2016 at 1:26 PM, Philip Hudson <phil.hudson@iname.com> wrote:
>>
>> You need to put the timestamp (%u) /after/ the drawer in the template.
>>
>> On 01/10/2016, Xebar Saram <zeltakc@gmail.com> wrote:
>> > Hi all
>> >
>> > so i have this useful to me capture template
>> >
>> > (add-to-list 'org-capture-templates
>> >                    '("un" "resturant"
>> >                      entry
>> >                     (file+headline
>> > "/home/zeltak/org/files/agenda/travel.org"
>> > "NYC")
>> >     "* TOVISIT %^{Description}
>> >     %u
>> >   :PROPERTIES:
>> >       :Rating: %^{rating?|-|1|2|3|4|5}
>> >       :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
>> >       :Source: %^{Source?}
>> >       :Type: %^{Type?|meal|breakfeast|dessert|street}
>> >       :Cuisine:
>> >
>> > %^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}
>> >       :Fav: %^{Fav|-|yes|no}
>> >       :END:
>> >     %?
>> >         "
>> >            ))
>> >
>> >
>> > as you can see im constructing a capture template that will add a
>> > propery
>> > drawer. i must be doping something wrong in my syntax as after a while
>> > when
>> > other input are added to the created header down the road (org-id, date
>> > etc) these create another property drawer. this looks like this
>> >
>> > **** TOVISIT Ample hill ice cream
>> >      :PROPERTIES:
>> >      :ID:       06a84670-baa9-4925-be93-b18252d6b684
>> >      :END:
>> >        [2016-10-01 Sat]
>> >      :PROPERTIES:
>> > :Rating: -
>> > :price: 0-10
>> > :Source: http://www.amplehills.com/
>> > :Type: dessert
>> > :Cuisine: American
>> > :Fav:
>> > :END:
>> >
>> > is there anyway to solve this issue? is my capture syntax wrong?
>> >
>> > best
>> >
>> > Z
>> >
>>
>>
>> --
>> phil.hudson@iname.com                      PGP/GnuPG ID: 0x887DCA63
>
>



-- 
Phil Hudson                   http://hudson-it.ddns.net
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Capture template creates multiple property drawers, help needed
  2016-10-01 13:25     ` Philip Hudson
@ 2016-10-01 15:55       ` Xebar Saram
  2016-10-01 17:52         ` Xebar Saram
  0 siblings, 1 reply; 6+ messages in thread
From: Xebar Saram @ 2016-10-01 15:55 UTC (permalink / raw)
  To: Philip Hudson; +Cc: emacs orgmode-mailinglist

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

thx phil

i now remember why i indented the  sub headers. i use a init.el file thats
an org file (that is i tangle my setting.org) into settings.el at startup
thus the above capture you kindly shared:

 #+BEGIN_SRC emacs-lisp  :results none

  ** TODO Finalize %?%^{item}
     SCHEDULED: <%(my-next-next-working-day)>
  *** TODO Process %\1
     SCHEDULED: <%(my-next-working-day)>
  **** TODO Prepare %\1
       SCHEDULED: %t
#+END_SRC

will break the actual lisp code blocks.

Does anyone know how to get around in org lisp code blocks in an org config?

best

Z

[-- Attachment #2: Type: text/html, Size: 1257 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Capture template creates multiple property drawers, help needed
  2016-10-01 15:55       ` Xebar Saram
@ 2016-10-01 17:52         ` Xebar Saram
  0 siblings, 0 replies; 6+ messages in thread
From: Xebar Saram @ 2016-10-01 17:52 UTC (permalink / raw)
  To: Philip Hudson; +Cc: emacs orgmode-mailinglist

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

i had an idea of using lisp to solve the header issue like
with %(org-insert-heading) , but that dosent seem do to anything. here is
the code:

(add-to-list 'org-capture-templates
                   '("uu" "resturant"
                     entry
                    (file+headline "/home/zeltak/org/files/agenda/travel.org"
"Inbox")
    "* %^{Description}
  :PROPERTIES:
      :ID: %(org-id-uuid)
      :Rating: %^{rating?|-|1|2|3|4|5}
      :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}
      :Source: %^{Source?}
      :Type: %^{Type?|meal|breakfeast|dessert|street}
      :Cuisine:
%^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Jewish|Japan}
      :Fav: %^{Fav|yes|no}
      :END:
%(org-insert-heading)
%?
"
))


anyone?

On Sat, Oct 1, 2016 at 6:55 PM, Xebar Saram <zeltakc@gmail.com> wrote:

> thx phil
>
> i now remember why i indented the  sub headers. i use a init.el file thats
> an org file (that is i tangle my setting.org) into settings.el at startup
> thus the above capture you kindly shared:
>
>  #+BEGIN_SRC emacs-lisp  :results none
>
>   ** TODO Finalize %?%^{item}
>      SCHEDULED: <%(my-next-next-working-day)>
>   *** TODO Process %\1
>      SCHEDULED: <%(my-next-working-day)>
>   **** TODO Prepare %\1
>        SCHEDULED: %t
> #+END_SRC
>
> will break the actual lisp code blocks.
>
> Does anyone know how to get around in org lisp code blocks in an org
> config?
>
> best
>
> Z
>

[-- Attachment #2: Type: text/html, Size: 2874 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-01 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-01  8:51 Capture template creates multiple property drawers, help needed Xebar Saram
2016-10-01 10:26 ` Philip Hudson
2016-10-01 11:05   ` Xebar Saram
2016-10-01 13:25     ` Philip Hudson
2016-10-01 15:55       ` Xebar Saram
2016-10-01 17:52         ` Xebar Saram

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).