From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Antczak Subject: How to programmatically use/edit data provided on capture Date: Sun, 03 Aug 2014 03:03:10 +0200 Message-ID: <53DD8A4E.5090504@neutrico-themes.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDkFW-0006BJ-51 for emacs-orgmode@gnu.org; Sat, 02 Aug 2014 21:06:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDkFO-0005Lk-Kl for emacs-orgmode@gnu.org; Sat, 02 Aug 2014 21:06:10 -0400 Received: from az0022.srv.az.pl ([46.242.145.22]:43272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDkFO-0005Lf-DA for emacs-orgmode@gnu.org; Sat, 02 Aug 2014 21:06:02 -0400 Received: from host099-182.izacom.pl ([194.116.182.99]:54543 helo=[192.168.1.102]) by az0022.srv.az.pl with esmtpsa (UNKNOWN:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1XDkFJ-001HdI-Hr for emacs-orgmode@gnu.org; Sun, 03 Aug 2014 03:05:59 +0200 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs orgmode-mailinglist Hi all! I got capture template with prompts to collect some properties: #+BEGIN_SRC * TODO %\1 / Some task description :PROPERTIES: :NAME: %^{NAME} :END: #+END_SRC My question is: How to get information on user input data to transform this data before capture finalize. For example: I got variable NAME and would like to use function like (s-dashed-words string) from s.el to make sure that my NAME is valid and converted to dashed syntax. Let's say that my input is: New random project I would like to have: #+begin_src * TODO new-random-project / Some task description :PROPERTIES: :NAME: "New random project" :END: #+end_src While currently I got: #+begin_src * TODO New random project / Some task description :PROPERTIES: :NAME: "New random project" :END: #+end_src I have been trying: #+BEGIN_SRC * TODO %(custom-dashify-function %\1) / Some task description :PROPERTIES: :NAME: %^{NAME} :END: #+END_SRC or #+BEGIN_SRC * TODO %(custom-dashify-function %\\1) / Some task description :PROPERTIES: :NAME: %^{NAME} :END: #+END_SRC But apparently function is executed before %\1 is replaced by my data and it dodesn't work. Could someone help me to write function that would get data I provided for property NAME, convert using s-dashed-words and return to template before finalize? Marcin