From: Bastien <bastienguerry@googlemail.com>
To: David Maus <maus.david@gmail.com>
Cc: Emacs-orgmode@gnu.org
Subject: Re: wish list: sort tasks by age
Date: Wed, 01 Jul 2009 13:58:09 +0200 [thread overview]
Message-ID: <87d48kipim.fsf@bzg.ath.cx> (raw)
In-Reply-To: <873a9gem4v.wl%maus.david@gmail.com> (David Maus's message of "Wed, 01 Jul 2009 12:24:48 +0200")
David Maus <maus.david@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
next prev parent reply other threads:[~2009-07-01 11:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 20:04 wish list: sort tasks by age Christopher League
[not found] ` <87tz1wzy1o.wl%maus.david@gmail.com>
2009-07-01 8:10 ` Manish
2009-07-01 10:24 ` David Maus
2009-07-01 11:58 ` Bastien [this message]
2009-07-01 13:26 ` Christopher League
2009-07-01 14:46 ` Bastien
2009-07-01 11:57 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d48kipim.fsf@bzg.ath.cx \
--to=bastienguerry@googlemail.com \
--cc=Emacs-orgmode@gnu.org \
--cc=maus.david@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).