emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastjan Trepca" <trepca@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Task time limit
Date: Sun, 10 Feb 2008 18:39:41 +0100	[thread overview]
Message-ID: <cd329af80802100939j706b2668oa8fb128aa954e5e2@mail.gmail.com> (raw)
In-Reply-To: <87zlxal744.fsf@bzg.ath.cx>

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 <bzg@altern.org> wrote:
> "Sebastjan Trepca" <trepca@gmail.com> 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
>

  reply	other threads:[~2008-02-10 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18 23:43 Task time limit Sebastjan Trepca
2007-11-19 13:03 ` Bastien
2008-02-10 17:39   ` Sebastjan Trepca [this message]
2008-02-10 18:57     ` Bastien Guerry
2008-02-10 19:18       ` Sebastjan Trepca
2008-02-10 19:47         ` Bastien Guerry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd329af80802100939j706b2668oa8fb128aa954e5e2@mail.gmail.com \
    --to=trepca@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).