title: Combine org mode capture and drill modules to learn vocabulary
body: <p>I want to use the <code>capture</code> module of <code>org-mode</code> to create a data base of new words that I want to learn, and then use the <code>drill</code> module to learn them (flash cards style).</p>
  
  <p>In my <code>org-capture-templates</code> I added the following:</p>
  
  <pre><code>("v" "Vocabulary" entry
                 (file+headline (concat org-directory "/vocab.org")
                                "Vocabulary")
                 "* Word :drill:\n%^ \n** Answer \n%^")
  </code></pre>
  
  <p>This is a rather naive template which I borrowed <a href="http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00924.html" rel="nofollow">from here</a>. It works fine but it is too limited. Unfortunately I'm rather new to <code>elisp</code> and I don't know how to improve it.</p>
  
  <p>I think the above template has to be improved in the following there aspects:</p>
  
  <p><strong>Headline</strong> Currently the first input string is the (new) word and the headline is fixed. How can the headline be the same (input) word? I think that the following result is desirable:</p>
  
  <pre><code>* Vocabulary
  ** Foo :drill:
  Foo
  *** Answer
  What is foo
  </code></pre>
  
  <p>Actually an even better way would be to have 3 input strings.</p>
  
  <ol>
  <li>The new word (for example <code>foo</code>) which will be the headline.</li>
  <li>If the second is empty, then it gets the same string as (1). Otherwise, concatenates the string to the one from (1). E.g. having as second input <code>bar</code> would yield <code>foo bar</code>. This will be the content of the entry.</li>
  <li>The word's definition which should come in the <code>answer</code> sub-headline.</li>
  </ol>
  
  <p><strong>Duplications</strong> (see again <a href="http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00924.html" rel="nofollow">this</a>) If at some later point I try to capture <code>foo</code> again, I would like to know it, and be directed to edit the already existing entry - skipping all the inputs.</p>
  
  <p><strong>Sorting</strong> After capturing I think it would be nice to sort the list of words. This should not be too hard given that the headline of each entry is the word itself. In this case one can probably use the <code>org-sort-entries</code> function.</p>
  
  <p>I know this is a rather big questions but I also think that if it can be solved here it will be of great use to many users.</p>
  
  <hr>
  
  <h1>Edits:</h1>
  
  <hr>
  
  <p>Using @juan_g suggestions, I improved my template and now it is:</p>
  
  <pre><code>("v" "Vocabulary" entry
                 (file+headline (concat org-directory "/vocab.org")
                                "Vocabulary")
                 "* %^{The word} :drill:\n %t\n %^{Extended word (may be empty)} \n** Answer \n%^{The definition}")
  </code></pre>
  
  <p>I didn't manage to set the default value of the second input to be the 1st one. I tried something like <code>%^{Extended word (may be empty)|%\1}</code> but it returns <code>^A</code> which is not helpful.</p>
  
  <p>In any case, this improved version seems to be already usable.</p>