Re: [Orgmode] Task time limit
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
Re: [Orgmode] Task time limit
Sebastjan Trepca [EMAIL PROTECTED] writes: Anyway, this new version works! :) Be careful about clocking out from agenda views if you're also advising org-clock-out. It doesn't work, I can't see why for now. Thank you very much, this will be very useful. Btw, why not integrate it with org-mode? I don't think this has to be part of org-mode. I'm not using it myself and I would be surprised if many people are using it. This is a strange way of using appointments as reminders. And most of the times you will clock the task out before the appt will pop up -- which means you really relies on `appt-message-warning-time' to tell you that you're about to reach the appointment... Anyway, I opened a page named org-adhoc-code.org on Worg: http://www.cognition.ens.fr/~guerry/worg/org-adhoc-code.html We could put other tiny pieces of code here in the future. -- 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
Re: [Orgmode] Task time limit
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
[Orgmode] Task time limit
Hi, another idea for a feature (if it's not already possible) that would definitely come handy. I have few tasks that should only take a limited amount of my time each day. 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. Is this possible with current version? Thanks, Sebastjan ___ 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