[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] wish list: sort tasks by age

From: Bastien
Subject: Re: [Orgmode] wish list: sort tasks by age
Date: Wed, 01 Jul 2009 13:58:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

David Maus <address@hidden> writes:

> 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.

Thanks for this David -- you might also have a look at the code in
org-expiry.el.  If there is anything there that you want to improve,
please do so!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]