From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Property Drawer question Date: Tue, 14 Aug 2007 19:57:33 -0400 Message-ID: <87abstk6tu.fsf@gollum.intra.norang.ca> References: <873aymktck.fsf@gollum.intra.norang.ca> <87k5rxiwi8.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IL6Gp-0002Ok-UB for emacs-orgmode@gnu.org; Tue, 14 Aug 2007 19:57:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IL6Gp-0002No-Ed for emacs-orgmode@gnu.org; Tue, 14 Aug 2007 19:57:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IL6Gp-0002Ng-8F for emacs-orgmode@gnu.org; Tue, 14 Aug 2007 19:57:55 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IL6Gn-0000Lr-RQ for emacs-orgmode@gnu.org; Tue, 14 Aug 2007 19:57:54 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IL6Gh-0005SL-67 for emacs-orgmode@gnu.org; Wed, 15 Aug 2007 01:57:47 +0200 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([74.119.210.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Aug 2007 01:57:47 +0200 Received: from bernt by cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Aug 2007 01:57:47 +0200 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 Bastien writes: > Bernt Hansen 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