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

> This is just 84 days old :)
Hehe, I guess I have a long queue ;)

Anyway, this new version works! :)

Thank you very much, this will be very useful. Btw, why not integrate
it with org-mode?


> > Copied into my .emacs file, changed the time to 1 minute, clocked in a
> > task, waited a minute and nothing happened :)
> Are you activating appointments with (appt-activate) somewhere?
> What is the output of M-x appt-delete RET ?
> Maybe you can try with a more realistic value of 20 minutes and check if
> the appt appears somewhere (with-x appt-delete RET)
> BTW, here is the last version I use, letting you to delete
> "appointments" if you clock out (only in the org-mode buffer):
> ;; Make sure you have a sensible value for `appt-message-warning-time'
> (defvar bzg-org-clock-in-appt-delay 100
>   "Number of minutes for setting an appointment by clocking-in")
> (defun bzg-org-clock-in-add-appt (&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 (match-string-no-properties 4))
>            (ct-time (decode-time))
>            (appt-min (+ (cadr ct-time)
>                         (or n bzg-org-clock-in-appt-delay)))
>            (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-clock-in-add-appt activate)
>   "Add an appointment when clocking a task in."
>   (bzg-org-clock-in-add-appt))
> (defun bzg-org-clock-out-delete-appt nil
>   "When clocking out, delete any associated appointment."
>   (interactive)
>   (save-excursion
>     (org-back-to-heading t)
>     (looking-at org-complex-heading-regexp)
>     (let* ((msg (match-string-no-properties 4)))
>       (setq appt-time-msg-list
>             (delete nil
>                     (mapcar
>                      (lambda (appt)
>                        (if (not (string-match (regexp-quote msg)
>                                               (cadr appt))) appt))
>                      appt-time-msg-list)))
>       (appt-check))))
> (defadvice org-clock-out (before org-clock-out-delete-appt activate)
>   "Delete an appointment when clocking a task out."
>   (bzg-org-clock-out-delete-appt))
> --
> Bastien


  reply	other threads:[~2008-02-10 19:18 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
2008-02-10 18:57     ` Bastien Guerry
2008-02-10 19:18       ` Sebastjan Trepca [this message]
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:

  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=cd329af80802101118w4897c046y666590b533686087@mail.gmail.com \
    --to=trepca@gmail.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \


* 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


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