emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Keith Swartz <gnu@oneroad.com>
To: "[orgmode]" <emacs-orgmode@gnu.org>
Subject: Lazy evaluation when defining org-remember-template
Date: Fri, 29 May 2009 23:24:58 -0700	[thread overview]
Message-ID: <4A20D13A.2000603@oneroad.com> (raw)

Okay, I apologize, because I think this is a really stupid elisp 
question. I'm a little rusty, after about eight years of complacency in 
my vast array of emacs customizations. But now that I've really gotten 
into using org-mode, I find myself hacking away again...and forgetful.

My org file has folders for each day of the week. I'd like to define a 
template for org-remember that sets the default folder to whatever the 
current day of the week is.

Here's what I'm using now:

(setq org-remember-templates
    (list (list '"Todo" '?t '"* TODO %?%^{To do} %^g\n  :LOGBOOK:\n  - 
Added: %U\n  :END:" '"d:/tmp/_my.todo" (format-time-string '"%A"))))

Works great, except for one problem. The (format-time-string) command is 
executed once, when my .emacs is run, and thus becomes wrong by the time 
midnight rolls around. Sure, I could create a macro so I could redefine 
the variable every morning with a couple of keystrokes, but that's about 
how many keystrokes I'm saving by not having to enter the day of the 
week when I file it. :-)

Is there a way I can make that command evaluate at the time it is 
invoked, rather than when it is defined? I vaguely recall doing 
something like this, but that was five job roles, three houses, two 
recessions, and two kids ago. :)

Thanks,
Keith

                 reply	other threads:[~2009-05-30  6:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4A20D13A.2000603@oneroad.com \
    --to=gnu@oneroad.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).