emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Richard Riley <rileyrgdev@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: sexp in org remember templates
Date: Mon, 26 Oct 2009 18:31:01 -0400	[thread overview]
Message-ID: <10440.1256596261@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Richard Riley <rileyrgdev@gmail.com> of "Mon, 26 Oct 2009 23:06:20 BST." <hc56gu$dn5$1@ger.gmane.org>

Richard Riley <rileyrgdev@gmail.com> 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

  parent reply	other threads:[~2009-10-26 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 22:06 sexp in org remember templates Richard Riley
2009-10-26 22:25 ` Richard Riley
2009-10-26 22:31 ` Nick Dokos [this message]
2009-10-26 23:04   ` Richard Riley

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=10440.1256596261@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rileyrgdev@gmail.com \
    /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).