[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Advanced capture template using Elisp functions: void-function/v
From: |
Karl Voit |
Subject: |
Re: [O] Advanced capture template using Elisp functions: void-function/void-variable |
Date: |
Mon, 9 May 2016 17:24:24 +0200 |
User-agent: |
slrn/pre1.0.0-18 (Linux) |
Hi!
Phil obviously did not want to embarrass me in public so he wrote me
an email which pointed me to my simple error: a typo "promt" instead
of "prompt" in the function name.
* Karl Voit <address@hidden> wrote:
>
> However, when I am using this capture definition, I end up with
> lots of "void-function" and "void-variable". Probably I have an escaping
> issue.
>
> ,----
>| (defun my-capture-prompt (prompt variable)
>| "PROMPT for string, save it to VARIABLE and insert it."
>| (make-local-variable variable)
>| (set variable (read-string (concat prompt ": ") nil
>my-capture-promt-history)))
At this point, I know how to type "prompt" in a proper way.
>| (defun my-capture-insert (variable)
>| "Insert content of VARIABLE."
>| (symbol-value variable))
Phil remarks that this is equivalent to eval() which I can't confirm
with my limited Elisp knowledge.
> Then I created a variable holding the complex template string:
>
> ,----
>| (setq my-capture-template-r6story "** TODO [[IPD:%(my-capture-promt \"IPD
>number\" 'my-ipd)]] %(my-capture-promt \"Story title\" 'my-title) [1/11]
> :US_%(my-capture-promt \"Short title\" 'my-short-title):
[...]
prompt, prompt, prompt, prompt, prompt, prompt.
Sorry for the fuzz. However, you might be pointed to a clever way
for capture templates.
--
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
> get Memacs from https://github.com/novoid/Memacs <
https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github