From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH 2/2] Do not issue the 'task should be finished by now' message if the clock is stopped Date: Tue, 9 Jun 2009 23:45:40 +0200 Message-ID: <291EC9EC-020C-49A8-AB30-96DD6E23480C@gmail.com> References: <1244580234-25563-2-git-send-email-bernt@norang.ca> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME98g-0000mH-Pz for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 17:45:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME98b-0000gi-Pa for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 17:45:49 -0400 Received: from [199.232.76.173] (port=42770 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME98b-0000gb-FK for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 17:45:45 -0400 Received: from mail-ew0-f225.google.com ([209.85.219.225]:50799) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME98a-00066a-Uz for emacs-orgmode@gnu.org; Tue, 09 Jun 2009 17:45:45 -0400 Received: by ewy25 with SMTP id 25so375997ewy.42 for ; Tue, 09 Jun 2009 14:45:43 -0700 (PDT) In-Reply-To: <1244580234-25563-2-git-send-email-bernt@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org All patches applied, thanks. - Carsten On Jun 9, 2009, at 10:43 PM, Bernt Hansen wrote: > This patch prevents the org-clock-sound notification and the > > "Task'BLAH' should be finished by now." > > message when the termination time is reached and the clock is not > running. > > Before this patch spurious notifications and messages were generated > when > clocking in a task with estimated effort time remaining. After > clocking > out the task the remaining minutes would tick by and then the sound > and message that the task should be finished were generated - even > though > you are not working on it anymore. > --- > This patch series is available at git://git.norang.ca/org-mode for- > carsten > > lisp/org-clock.el | 21 +++++++++++---------- > 1 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index 57f1a6f..ace7792 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -369,16 +369,17 @@ previous clocking intervals." > (defun org-clock-notify-once-if-expired () > "Show notification if we spent more time then we estimated before. > Notification is shown only once." > - (let ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock- > effort)) > - (clocked-time (org-clock-get-clocked-time))) > - (if (>= clocked-time effort-in-minutes) > - (unless org-clock-notification-was-shown > - (setq org-clock-notification-was-shown t) > - (org-clock-play-sound) > - (org-show-notification > - (format "Task '%s' should be finished by now. (%s)" > - org-clock-heading org-clock-effort))) > - (setq org-clock-notification-was-shown nil)))) > + (when (marker-buffer org-clock-marker) > + (let ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock- > effort)) > + (clocked-time (org-clock-get-clocked-time))) > + (if (>= clocked-time effort-in-minutes) > + (unless org-clock-notification-was-shown > + (setq org-clock-notification-was-shown t) > + (org-clock-play-sound) > + (org-show-notification > + (format "Task '%s' should be finished by now. (%s)" > + org-clock-heading org-clock-effort))) > + (setq org-clock-notification-was-shown nil))))) > > (defun org-show-notification (notification) > "Show notification. Use libnotify, if available." > -- > 1.6.3.2.198.g6096d > > > > _______________________________________________ > 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