emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: emacs-orgmode@gnu.org
Subject: Re: Advanced capture template using Elisp functions: void-function/void-variable
Date: Mon, 9 May 2016 17:24:24 +0200	[thread overview]
Message-ID: <2016-05-09T17-19-42@devnull.Karl-Voit.at> (raw)
In-Reply-To: 2016-05-09T15-13-42@devnull.Karl-Voit.at

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 <devnull@Karl-Voit.at> 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

      reply	other threads:[~2016-05-09 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 13:40 Advanced capture template using Elisp functions: void-function/void-variable Karl Voit
2016-05-09 15:24 ` Karl Voit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2016-05-09T17-19-42@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).