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 07:53:08 -0500 Message-ID: <83884.1291812788@iu.edu> References: <87y681nf2i.fsf@norang.ca> Content-Type: text/plain; charset=utf-8; format=flowed Return-path: Received: from [140.186.70.92] (port=34355 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQJWE-0006sz-43 for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 07:53:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQJWC-0003gU-IN for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 07:53:13 -0500 Received: from locrian.itso.iu.edu ([149.166.143.64]:61611 helo=locrian.uiso.iu.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQJWC-0003eP-FO for emacs-orgmode@gnu.org; Wed, 08 Dec 2010 07:53:12 -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 5B72F2A9AB5 for ; Wed, 8 Dec 2010 07:53:09 -0500 (EST) In-reply-to: <87y681nf2i.fsf@norang.ca> 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 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 #+begin_src emacs-lisp (defadvice org-insert-todo-heading (after ajk/org-time-stamp-new-headline activate compile) (let ((previous-location (point))) ; not sure why save-excursion doesn't work (org-insert-time-stamp (current-time) t t (concat "\n " (make-string (org-current-level) ? ))) (goto-char previous-location))) #+end_src Here's my vote for a new hook, org-insert-todo-heading-hook. :-) ajk