From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org capture properties from a list of strings? Date: Tue, 25 Apr 2017 18:19:20 +0200 Message-ID: <87h91czchj.fsf@nicolasgoaziou.fr> References: <87y3uozzlm.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d33BX-0008A9-IO for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 12:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d33BT-0004fO-F3 for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 12:19:27 -0400 Received: from relay7-d.mail.gandi.net ([2001:4b98:c:538::200]:48529) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d33BT-0004f3-99 for emacs-orgmode@gnu.org; Tue, 25 Apr 2017 12:19:23 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by relay7-d.mail.gandi.net (Postfix) with ESMTPS id A1A7E3816 for ; Tue, 25 Apr 2017 18:19:21 +0200 (CEST) In-Reply-To: (Xebar Saram's message of "Tue, 25 Apr 2017 18:56:37 +0300") 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 Hello, Xebar Saram writes: > 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?) Yes, you do. However, #'number-to-string is only useful if you're inserting numbers. I think you can use the more general #'prin1-to-string everywhere instead, e.g., (mapconcat #'prin1-to-string '(Indian Thai Vietnamese Asian Chinese) "|") or even, using strings (mapconcat #'identity '("Indian" "Thai" "Vietnamese" "Asian" "Chinese") "|") > and how dows the %s know which mapconcat command to refer to? The are processed by order. The first "%s" refers to the first mapconcat, the second "%s" to the second mapconcat, and so on... Regards, -- Nicolas Goaziou 0x80A93738