From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: using %(sexp) in remember templates Date: Mon, 15 Jun 2009 01:01:57 -0400 Message-ID: <29830.1245042117@gamaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MG4Li-00024l-B8 for emacs-orgmode@gnu.org; Mon, 15 Jun 2009 01:03:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MG4Lg-00021s-M6 for emacs-orgmode@gnu.org; Mon, 15 Jun 2009 01:03:13 -0400 Received: from [199.232.76.173] (port=50901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MG4Lg-00021i-IY for emacs-orgmode@gnu.org; Mon, 15 Jun 2009 01:03:12 -0400 Received: from qmta15.emeryville.ca.mail.comcast.net ([76.96.27.228]:37202) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MG4Lf-0008LG-SW for emacs-orgmode@gnu.org; Mon, 15 Jun 2009 01:03:12 -0400 In-Reply-To: Message from Shelagh Manton of "Sun, 14 Jun 2009 23:27:47 -0000." 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: Shelagh Manton Cc: emacs-orgmode@gnu.org Shelagh Manton 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