emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Shelagh Manton <shelagh.manton@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: using %(sexp) in remember templates
Date: Mon, 15 Jun 2009 01:01:57 -0400	[thread overview]
Message-ID: <29830.1245042117@gamaville> (raw)
In-Reply-To: Message from Shelagh Manton <shelagh.manton@gmail.com> of "Sun, 14 Jun 2009 23:27:47 -0000." <h1411j$4fm$1@ger.gmane.org>

Shelagh Manton <shelagh.manton@gmail.com> wrote:

> I'm trying to make a remember template that inserts some text 
> automatically.
> 
> I read in the manual that %(sexp) would expand in the template. This 
> would be what I want, if I've understood the manual aright. 
> 
> I made a small function that inserts text (org-csa) and this is the 
> template I originally tried.
> ("CSA" ?C "* TODO %^{topic} %^g\n %t\n %(org-csa) %&" "CSA.org" bottom)
> 
The function should not insert anything into any buffer: it should
*return* what you want to be inserted. For example, the following
minimal .emacs works just fine (after fixing the path appropriately):

,----
| (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
| (require 'org-install)
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| 
| ;;;; 
| (setq org-remember-templates '(("CSA" ?C "* TODO %^{topic} %^g\n %t\n %(org-csa) %&" "CSA.org" bottom)))
| (defun org-csa ()
|     "foobar")
| (org-remember-insinuate)
| 
| ;;;;;
`----

HTH,
Nick

  reply	other threads:[~2009-06-15  5:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 23:27 using %(sexp) in remember templates Shelagh Manton
2009-06-15  5:01 ` Nick Dokos [this message]
2009-06-15  5:16   ` Shelagh Manton

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=29830.1245042117@gamaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=shelagh.manton@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).