emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Scheduling time+effort or (ab-?)using org-agenda-default-duration


From: Memnon Anon
Subject: [O] Scheduling time+effort or (ab-?)using org-agenda-default-duration
Date: Tue, 19 Jun 2012 19:26:31 +0000 (UTC)

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 :)





reply via email to

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