emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Shelagh Manton <shelagh.manton@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: using %(sexp) in remember templates
Date: Mon, 15 Jun 2009 05:16:11 +0000 (UTC)	[thread overview]
Message-ID: <h14leq$7dp$1@ger.gmane.org> (raw)
In-Reply-To: 29830.1245042117@gamaville

On Mon, 15 Jun 2009 01:01:57 -0400, Nick Dokos wrote:

> 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
> 
> 
So my problem is that my function org-csa is inserting text? I will try 
this out.

Ah thanks that works nicely. A conceptual dissonance between returning 
values and inserting text.

Shelagh
> 
> 
> 
> _______________________________________________ Emacs-orgmode mailing
> list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2009-06-15  5:16 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
2009-06-15  5:16   ` Shelagh Manton [this message]

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='h14leq$7dp$1@ger.gmane.org' \
    --to=shelagh.manton@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).