From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: Re: Advanced capture template using Elisp functions: void-function/void-variable Date: Mon, 9 May 2016 17:24:24 +0200 Message-ID: <2016-05-09T17-19-42@devnull.Karl-Voit.at> References: <2016-05-09T15-13-42@devnull.Karl-Voit.at> Reply-To: Karl Voit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aznKm-0004yY-Gi for emacs-orgmode@gnu.org; Mon, 09 May 2016 11:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aznKf-00016v-N6 for emacs-orgmode@gnu.org; Mon, 09 May 2016 11:42:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:34288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aznKf-00015t-CZ for emacs-orgmode@gnu.org; Mon, 09 May 2016 11:42:53 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aznCd-0003m2-Vn for emacs-orgmode@gnu.org; Mon, 09 May 2016 17:34:36 +0200 Received: from friends.grml.info ([136.243.234.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2016 17:34:35 +0200 Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 May 2016 17:34:35 +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" To: emacs-orgmode@gnu.org 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 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