From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew J. Korty" Subject: Re: Re: Automatically insert inactive timestamps Date: Wed, 08 Dec 2010 12:25:40 -0500 Message-ID: <87687.1291829140@iu.edu> References: <87y681nf2i.fsf@norang.ca> <83884.1291812788@iu.edu> <12555.1291821014@gamaville.dokosmarshall.org> Content-Type: text/plain; charset=utf-8; format=flowed Return-path: Received: from [140.186.70.92] (port=48335 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQNlw-0001M3-An for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 12:25:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQNlt-0007La-TW for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 12:25:44 -0500 Received: from locrian.itso.iu.edu ([149.166.143.64]:62187 helo=locrian.uiso.iu.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQNlt-0007LC-M1 for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 12:25:41 -0500 Received: from iu.edu (149-166-143-228.dhcp-in.iupui.edu [149.166.143.228]) by locrian.uiso.iu.edu (Postfix) with ESMTPA id B039B2A9BDC for ; Wed, 8 Dec 2010 12:25:40 -0500 (EST) In-reply-to: <12555.1291821014@gamaville.dokosmarshall.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: emacs-orgmode@gnu.org Nick Dokos wrote: > Andrew J. Korty wrote: > > > Bernt Hansen wrote: > > > > > (add-hook 'org-insert-heading-hook 'bh/insert-heading-inactive-timestamp) > > > > Using org-insert-heading-hook is more elegant than my way, but I only > > want timestamps on TODO entries, so I use > > > > I think you should be able to use org-entry-get in the hook to get the > TODO property of the entry and then conditionally add the timestamp - > something like this: > > (if (equal (org-entry-get (point) "TODO") "TODO") > add the timestamp Iirc, the problem is that the entry doesn't yet have a todo keyword at the time the hook is run. ajk