emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] How to programmatically use/edit data provided on capture


From: Marcin Antczak
Subject: [O] How to programmatically use/edit data provided on capture
Date: Sun, 03 Aug 2014 03:03:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]