From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Feature Request Date: Tue, 26 Sep 2006 14:37:27 +0200 Message-ID: <6b49125ddc270e8732b471029ab82eb5@science.uva.nl> References: <20060925235852.GA32259@keroberos> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GSCBu-00047V-VI for emacs-orgmode@gnu.org; Tue, 26 Sep 2006 08:37:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GSCBt-00046D-Ay for emacs-orgmode@gnu.org; Tue, 26 Sep 2006 08:37:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSCBt-00045y-5s for emacs-orgmode@gnu.org; Tue, 26 Sep 2006 08:37:37 -0400 Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GSCGW-0001f4-4S for emacs-orgmode@gnu.org; Tue, 26 Sep 2006 08:42:24 -0400 In-Reply-To: <20060925235852.GA32259@keroberos> 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: Russell Adams Cc: emacs-orgmode@gnu.org On Sep 26, 2006, at 1:58, Russell Adams wrote: > I've gotten in a habit of storing my todo's in the following format, > and I'm curious if there's a way to automate this... > > * Daily > ** 2006-09 > *** 2006-09-25 > **** TODO Item One > > I don't always have an item for each day, its sparsely populated, but > I'd like to automate making the first few headings. > > Any suggestions? Even a macro? ;] The cl macro "loop" is your friend.... (defun my-date-tree (y1 y2) (interactive "nFirst year: \nnLast year: ") (require 'calendar) (loop for y from y1 to y2 do (message "Doing year %d..." y) (insert "* " (format "%4d" y) "\n") (loop for m from 1 to 12 do (insert "** " (format "%4d-%02d" y m) "\n") (loop for d from 1 to 31 do (when (= m (car (calendar-gregorian-from-absolute (calendar-absolute-from-gregorian (list m d y))))) (insert "*** " (format "%4d-%02d-%02d" y m d) "\n")))))) Hope this helps - Carsten