[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Lazy evaluation when defining org-remember-template

From: Keith Swartz
Subject: [Orgmode] Lazy evaluation when defining org-remember-template
Date: Fri, 29 May 2009 23:24:58 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070326 Thunderbird/ Mnenhy/

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. :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]