From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: wish list: sort tasks by age Date: Wed, 01 Jul 2009 12:24:48 +0200 Message-ID: <873a9gem4v.wl%maus.david@gmail.com> References: <9FE27D7D-3CB3-4B17-9061-0AFF0FCD0AFF@contrapunctus.net> <87tz1wzy1o.wl%maus.david@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLwzq-0001SE-UQ for emacs-orgmode@gnu.org; Wed, 01 Jul 2009 06:24:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLwzm-0001Q3-0w for Emacs-orgmode@gnu.org; Wed, 01 Jul 2009 06:24:58 -0400 Received: from [199.232.76.173] (port=50171 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLwzl-0001Pw-Sc for Emacs-orgmode@gnu.org; Wed, 01 Jul 2009 06:24:53 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:54277) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLwzl-0001W3-Il for Emacs-orgmode@gnu.org; Wed, 01 Jul 2009 06:24:53 -0400 Received: by fxm17 with SMTP id 17so272885fxm.42 for ; Wed, 01 Jul 2009 03:24:52 -0700 (PDT) In-Reply-To: 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 At Wed, 1 Jul 2009 13:40:21 +0530, Manish wrote: > > There are property and mapping APIs documented in the manual under > section on hacking. And what a fun it is to train my elisp skills. A first hack that seems to work: (defun dmj/org-assure-creation-property () "Process all orgmode entries of current buffer that do not match a defined search string" (interactive) (org-map-entries 'dmj/org-insert-creation-property "+Creation_Time=\"\"") ) (defun dmj/org-insert-creation-property () "Insert Creation-Property in Orgmode entry at point" (let ((stamp (format-time-string (cdr org-time-stamp-formats) (current-time)))) (setq stamp (concat "[" (substring stamp 1 -1) "]")) (org-entry-put (point-marker) "Creation_Time" stamp)) ) The first function (dmj/assure-creation-property) processes every entry in current buffer that match the search query Creation_Time="", i.e. entries with an empty or no Creation_Time property at all and calls dmj/org-insert-creation-property to insert a Creation_Time property with the current time into this entry. The tag search query should be refined to only match headlines with (certain) TODO keywords. The first function is defined as interactive so you can call it via M-x -- and of course this is just a fast hack with no warranty at all. Regards -- David -- OpenPGP... 0x316F4BE4670716FD Jabber.... dmjena@jabber.org Email..... maus.david@gmail.com ICQ....... 241051416