From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Feature Request Date: Thu, 8 Feb 2007 17:46:01 +0100 Message-ID: <8e8aed769bb343fd1e5a4d66f688e2f0@science.uva.nl> References: <20060925235852.GA32259@keroberos> <6b49125ddc270e8732b471029ab82eb5@science.uva.nl> <20060927150921.GB17927@keroberos> <20070208160549.GB16624@odin.demosthenes.org> 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 1HFCPN-0002yB-6n for emacs-orgmode@gnu.org; Thu, 08 Feb 2007 11:46:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFCPL-0002xy-QH for emacs-orgmode@gnu.org; Thu, 08 Feb 2007 11:46:04 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFCPL-0002xv-KD for emacs-orgmode@gnu.org; Thu, 08 Feb 2007 11:46:03 -0500 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HFCPK-00088v-Q5 for emacs-orgmode@gnu.org; Thu, 08 Feb 2007 11:46:03 -0500 In-Reply-To: <20070208160549.GB16624@odin.demosthenes.org> 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 On Feb 8, 2007, at 17:05, Russell Adams wrote: > I started tinkering, this being my first macro. Looks very good already. > > I can't say its behaving as I expected. > > (defun my-daily-insertion Every funtion needs an argument list, even if it is the empty one: (defun my-daily-insertion () > (interactive) > (beginning-of-buffer) Correct, but better use (goto-char (point-min)), has fewer side effects. > (re-search-forward "DAILY-INSERTION-POINT") > (forward-line -1) > (insert "*** " (format-time-string "%Y%m%d" (current-time)) ) > ) Looks all fine to me. - Carsten > > I'd welcome input. > > Russell > > On Wed, Sep 27, 2006 at 10:09:21AM -0500, Russell Adams wrote: >> The way I'm reading that macro, it'll prompt me for a date, etc. That >> would be useful for creating a range of dates in a tree if I needed to >> define a time period. >> >> I guess I didn't explain myself clearly. I wanted to generate those >> dated headings under the "Daily" heading for the current date >> only. Just a shortcut so I can hit a single key to add todo items for >> today, and have them added to my chronological "Daily" tree. >> >> I've just found that I'm managing TODO and agenda scheduled items >> well, but I didn't have a good way to handle all the little >> miscellaneous items that pop up. No reason to spend time filing them >> elsewhere, just a date would suffice. It also helps keep the tree >> sparse when searching. >> >> Russell >> >> On Tue, Sep 26, 2006 at 02:37:27PM +0200, Carsten Dominik wrote: >>> >>> 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 >>> >> ------------------------------------------------------------------ >> Russell Adams RLAdams@AdamsInfoServ.com >> >> PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ >> >> Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Carsten Dominik Sterrenkundig Instituut "Anton Pannekoek" Universiteit van Amsterdam Kruislaan 403 NL-1098SJ Amsterdam phone: +31 20 525 7477