From mboxrd@z Thu Jan 1 00:00:00 1970 From: Memnon Anon Subject: Scheduling time+effort or (ab-?)using org-agenda-default-duration Date: Tue, 19 Jun 2012 19:26:31 +0000 (UTC) Message-ID: <878vfj180y.fsf@mean.albasani.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh44k-00014U-Dm for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 15:26:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh44i-00084A-Hh for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 15:26:53 -0400 Received: from plane.gmane.org ([80.91.229.3]:33292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh44i-00083q-At for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 15:26:52 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sh44Z-0003uA-WB for emacs-orgmode@gnu.org; Tue, 19 Jun 2012 21:26:44 +0200 Received: from e178208180.adsl.alicedsl.de ([85.178.208.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jun 2012 21:26:43 +0200 Received: from gegendosenfleisch by e178208180.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jun 2012 21:26:43 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi org people, I am trying to make my life a bit easier and would love some advice. * Short: Has anyone a little schedule/timestamp function which takes time of day (e.g. 10:20 or 10pm) and schedules/timestamps items as time+effort (e.g. 10:20+0:30)? A tiny change to org-agenda-format-item (s.b.) seems to work, but I am worried about side effects. * Long: Whenever new things come up, I quickly capture it, set a reasonable effort and schedule it for tomorrow unless there is a cogent reason to do otherwise. Each morning, I go through my daily agenda, do some rescheduling if necessary and happily start ticking things of the list. So far, I avoided setting specific time-slots for items. However, I feel like it is time to test a different approach and actually assign times. So I start with a bunch of items and want to shuffle them around in the timetable, or rather sort them morning to evening. I usually (always?!) finish items in one run, so it would be convenient to just enter a start time and get a timestamp with a duration of starttime+effort. I had a look at the different functions involved, and bumped into `org-agenda-default-appointment-duration' (didn't know about that one) which is used in `org-agenda-format-item' (and only there afaict). #+begin_src emacs-lisp ;; Try to set s2 if s1 and `org-agenda-default-appointment-duration' are set (when (and s1 (not s2) org-agenda-default-appointment-duration) (setq s2 (org-minutes-to-hh:mm-string (+ (org-hh:mm-string-to-minutes s1) org-agenda-default-appointment-duration)))) #+end_src The easiest way to get the behavior I think I would like is a tiny change like #+begin_src emacs-lisp ;; Try to set s2 if s1 and `org-agenda-default-appointment-duration' are set (when (and s1 (not s2) org-agenda-default-appointment-duration) (if (org-get-effort) ; prefer effort over org-agenda-default-appointment-duration (setq s2 (org-minutes-to-hh:mm-string (+ (org-hh:mm-string-to-minutes s1) (org-duration-string-to-minutes (org-get-effort))))) (setq s2 (org-minutes-to-hh:mm-string (+ (org-hh:mm-string-to-minutes s1) org-agenda-default-appointment-duration))))) #+end_src ... which seems to work afaict after very superficial testing. Are there any side effects I missed? Breaking org would seriously mess up my life :)