From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: sexp in org remember templates Date: Mon, 26 Oct 2009 18:31:01 -0400 Message-ID: <10440.1256596261@gamaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2Y7P-0003a6-Qr for emacs-orgmode@gnu.org; Mon, 26 Oct 2009 18:32:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2Y7I-0003X9-Sg for emacs-orgmode@gnu.org; Mon, 26 Oct 2009 18:32:51 -0400 Received: from [199.232.76.173] (port=44993 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2Y7I-0003X2-NU for emacs-orgmode@gnu.org; Mon, 26 Oct 2009 18:32:44 -0400 Received: from vms173019pub.verizon.net ([206.46.173.19]:63331) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2Y7I-0003y3-GL for emacs-orgmode@gnu.org; Mon, 26 Oct 2009 18:32:44 -0400 Received: from gamaville.dokosmarshall.org ([173.76.32.106]) by vms173019.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KS500F9W7VF6NS2@vms173019.mailsrvcs.net> for emacs-orgmode@gnu.org; Mon, 26 Oct 2009 17:30:56 -0500 (CDT) In-reply-to: Message from Richard Riley of "Mon, 26 Oct 2009 23:06:20 BST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Riley Cc: emacs-orgmode@gnu.org Richard Riley wrote: > > Not being much of an elisp programmer and just returning to try and > integrate with org-learn a little :- > > This > > ("vocab"?v "* Learn TODO %(format '%s' rgr/orig-word) > :VOCAB:\n:PROPERTIES:\n:orig:\t%(format '%s' > rgr/orig-word)\n:trans:\t%(format '%s' > rgr/trans-word)\n:END:%!" nil bottom nil) > > fails me by outputting: > At the very least, you need to avoid single quotes for quoting strings - a single quote has a very special meaning to lisp in general: it inhibits evaluation of the following sexp. Try something like this instead: ("vocab"?v "* Learn TODO %(format \"%s\" rgr/orig-word) :VOCAB:\n:PROPERTIES:\n:orig:\t%(format \"%s\" rgr/orig-word)\n:trans:\t%(format \"%s\" rgr/trans-word)\n:END:%!" nil bottom nil) However, no guarantees: when (or even whether) the format calls will be executed (let alone whether they'll produce the correct result) depends on the code that handles this construct. There have been a couple of questions on the mailing list about such evaluations in the context of org-remember-templates, and IIRC, Carsten had added an evaluation mechanism there - see e.g. the thread at http://thread.gmane.org/gmane.emacs.orgmode/14521 and another thread referenced therein for some details. But I don't know if this will do what you need it to do. HTH, Nick