emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Property Drawer question


From: Bernt Hansen
Subject: [Orgmode] Re: Property Drawer question
Date: Tue, 14 Aug 2007 19:57:33 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Bastien <address@hidden> writes:

> Bernt Hansen <address@hidden> writes:
>
>> I'm starting to play with property drawers and I am thinking this
>> would be a good place to store estimated durations for tasks with
>> something like
>
> Actually the property-related functions in Org have been set for this
> purpose -- see the historical (!) thread here:
>
>   http://article.gmane.org/gmane.emacs.orgmode/2020
>
>> I'd like to globally set up
>>
>>   :time_ALL: 10m 30m 1h 2h 4h 6h 12h 18h 24h 30h
>
> I don't know about any "global" solution for setting properties (except
> for #+COLUMNS). But since you unleashed the word "template", i think we
> could think about something like this:
>
> #+PROPERTIES: :ITEM: A default heading
> #+PROPERTIES: :time_ALL: 10m 30m 1h 2h 4h 6h 12h 18h 24h 30h 
> #+PROPERTIES: :time: 10m :TAGS: @HOME @WORK
>
> (I think grouping is not important here, since it always a succession of
> pairs like :keyword: value(s).)
>
>> Also I'd like org-insert-property-drawer to always have this :time:
>> 10m default entry when new property drawers are created. Is there a
>> way to specify the drawer template somehow?
>
> Maybe you could advise `org-insert-property-drawer' like this:
>
> (defadvice org-insert-property-drawer (after add-time-property)
>   "Add a :Time: property after inserting a property drawer."
>   (let ((pos (point)))
>     (org-entry-put (point) "Time" "10m")
>     (goto-char pos)))
>
> (ad-activate 'org-insert-property-drawer)
>
> Or even advise `org-insert-heading' [M-RET]:
>
> (defadvice org-insert-heading (after add-custom-time-property)
>   "Add a custom :Time: property after heading insertion."
>   (let ((pos (point)))
>     (org-insert-property-drawer)
>     (org-entry-put (point) "time" "10m")
>     (goto-char pos)))
>
> (ad-activate 'org-insert-heading)
>
> Hope this helps,

Thanks!

I'll try that out.  My lisp-foo isn't very strong yet :)

Bernt





reply via email to

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