I finally got time to try this code :) Copied into my .emacs file, changed the time to 1 minute, clocked in a task, waited a minute and nothing happened :)
What could I be doing wrong? Thanks, Sebastjan On Nov 19, 2007 2:03 PM, Bastien <[EMAIL PROTECTED]> wrote: > "Sebastjan Trepca" <[EMAIL PROTECTED]> writes: > > > For example, "check the feed reader" would be set to 20 minutes. I > > would clock-in the task, go and check the reader and after 20 mins, > > alarm would go off, reminding me that I should start doing something > > else. > > Nice idea, I gave it a shot. > > I advised `org-clock-in' so that each time I am clocking in a new task, > a new appointment is triggered. `my-org-appt-add' can also be called > interactively. > > ;; Make sure you have a sensible value for `appt-message-warning-time' > (defun my-org-appt-add (&optional n) > "Add an appointment for the Org entry at point in N minutes." > (interactive) > (save-excursion > (org-back-to-heading t) > (looking-at org-complex-heading-regexp) > (let* ((msg (concat (match-string-no-properties 4) > " *GAME OVER*")) > (ct-time (decode-time)) > (appt-min (+ (cadr ct-time) (or n 20))) > (appt-time ; define the time for the appointment > (progn (setf (cadr ct-time) appt-min) ct-time))) > (appt-add (format-time-string > "%H:%M" (apply 'encode-time appt-time)) msg) > (if (interactive-p) (message "New appointment for %s" msg))))) > > (defadvice org-clock-in (after org-appt-add-after-clock-in activate) > "Add an appointment after clocking in a task." > (my-org-appt-add)) > > Maybe another idea is to bind (progn (org-clock-in) (my-org-appt-add)) > to a key in org-agenda-mode-map, since advising `org-clock-in' is a bit > too much IMO. Or we could use some kind of filtering to decide whether > clockin in an entry should trigger a new appointment. > > Anyway, that's just a quickstart, let me know if this is useful. > > -- > Bastien > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode