From: Xebar Saram <zeltakc@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: org capture properties from a list of strings?
Date: Tue, 25 Apr 2017 18:56:37 +0300 [thread overview]
Message-ID: <CAOQHXPoNsCqRqx+W2GgMdxbFAPQqoFBpBukqBL+t6ZwkOGgRpg@mail.gmail.com> (raw)
In-Reply-To: <87y3uozzlm.fsf@nicolasgoaziou.fr>
[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]
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 <mail@nicolasgoaziou.fr>
wrote:
> Hello,
>
> Xebar Saram <zeltakc@gmail.com> 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
>
[-- Attachment #2: Type: text/html, Size: 3387 bytes --]
next prev parent reply other threads:[~2017-04-25 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 14:41 org capture properties from a list of strings? Xebar Saram
2017-04-25 7:45 ` Xebar Saram
2017-04-25 8:00 ` Nicolas Goaziou
2017-04-25 15:56 ` Xebar Saram [this message]
2017-04-25 16:19 ` Nicolas Goaziou
2017-04-26 12:28 ` Xebar Saram
2017-04-26 14:13 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOQHXPoNsCqRqx+W2GgMdxbFAPQqoFBpBukqBL+t6ZwkOGgRpg@mail.gmail.com \
--to=zeltakc@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.