From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Swartz Subject: Lazy evaluation when defining org-remember-template Date: Fri, 29 May 2009 23:24:58 -0700 Message-ID: <4A20D13A.2000603@oneroad.com> Reply-To: Keith Swartz Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MAI1w-0006mM-Sq for emacs-orgmode@gnu.org; Sat, 30 May 2009 02:26:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MAI1r-0006lp-RX for emacs-orgmode@gnu.org; Sat, 30 May 2009 02:26:55 -0400 Received: from [199.232.76.173] (port=37919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MAI1q-0006lm-Ss for emacs-orgmode@gnu.org; Sat, 30 May 2009 02:26:50 -0400 Received: from smtpauth01.csee.onr.siteprotect.com ([64.26.60.145]:34292) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MAI1q-0000ly-IZ for emacs-orgmode@gnu.org; Sat, 30 May 2009 02:26:50 -0400 Received: from [192.168.1.134] (unknown [98.203.142.243]) (Authenticated sender: kswartz2@oneroad.com) by smtpauth01.csee.onr.siteprotect.com (Postfix) with ESMTP id E47E81C8047 for ; Sat, 30 May 2009 01:26:48 -0500 (CDT) 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: "[orgmode]" 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