David Maus <maus.da...@gmail.com> 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! -- Bastien _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode