From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: [PATCH] added a new modeline face for tasks which have overrun their effort estimate Date: Wed, 20 Jan 2010 06:22:03 +0100 Message-ID: References: <4b56672b.0305560a.53c2.ffffcdc0@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXT1b-00036X-R9 for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 00:22:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXT1X-00033W-5g for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 00:22:39 -0500 Received: from [199.232.76.173] (port=57901 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXT1W-00033S-Rw for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 00:22:34 -0500 Received: from lo.gmane.org ([80.91.229.12]:37547) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NXT1W-0000NZ-Ez for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 00:22:34 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NXT1Q-0004fU-Sc for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 06:22:28 +0100 Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Jan 2010 06:22:28 +0100 Received: from rileyrgdev by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Jan 2010 06:22:28 +0100 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: emacs-orgmode@gnu.org I believe I now have a repo set up that can be pulled from. Not sure if its done the correct way since I didnt clone org-mode. Rather I pushed my clone master and then the overrun branch. I *think* that should be ok. Anyway, the URL is http://repo.or.cz/w/rgr-org-mode.git and the branch with patch is called "overrun". Sorry about the octopus at the head of overrun - you will note that I didnt set my email properly and all hell broke loose as I tried to reset the head and .... Any comments on usage to put me further onto the right track, if I have strayed, most welcome! regards r. Richard Riley writes: > This small patch (be gentle, its my first) adds a new > face,org-mode-line-clock-overrun, for the modeline task clock when a > task has overrun its allotted Estimate. > > I will try to set up the remote repo thing described here > http://orgmode.org/worg/org-contribute.php#sec-3 but I'm not 100% sure > of what it is I'm supposed to set up there. Should it be a mirror of the > master git repo? > > Comments on elisp ineptitude welcome. > > Subject: [PATCH] added a new modeline face for tasks which have overrun > their effort estimate > > --- > lisp/org-clock.el | 8 +++++--- > lisp/org-faces.el | 2 ++ > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index 07f5e81..03df5b6 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -388,6 +388,8 @@ pointing to it." > (insert (format "[%c] %-15s %s\n" i cat task)) > (cons i marker))))) > > +(defvar org-task-overrun nil) > + > (defun org-clock-get-clock-string () > "Form a clock-string, that will be show in the mode line. > If an effort estimate was defined for current item, use > @@ -406,6 +408,7 @@ If not, show simply the clocked time like 01:50." > h m org-clock-heading)))) > > (defun org-clock-update-mode-line () > + (if org-clock-effort (org-clock-notify-once-if-expired)) > (setq org-mode-line-string > (org-propertize > (let ((clock-string (org-clock-get-clock-string)) > @@ -417,8 +420,7 @@ If not, show simply the clocked time like 01:50." > (org-propertize clock-string 'help-echo help-text))) > 'local-map org-clock-mode-line-map > 'mouse-face (if (featurep 'xemacs) 'highlight 'mode-line-highlight) > - 'face 'org-mode-line-clock)) > - (if org-clock-effort (org-clock-notify-once-if-expired)) > + 'face (if org-task-overrun 'org-mode-line-clock-overrun 'org-mode-line-clock))) > (force-mode-line-update)) > > (defun org-clock-get-clocked-time () > @@ -473,7 +475,7 @@ Notification is shown only once." > (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) > + (if (setq org-task-overrun (>= clocked-time effort-in-minutes )) > (unless org-clock-notification-was-shown > (setq org-clock-notification-was-shown t) > (org-notify > diff --git a/lisp/org-faces.el b/lisp/org-faces.el > index e3294eb..dad2b5e 100644 > --- a/lisp/org-faces.el > +++ b/lisp/org-faces.el > @@ -641,6 +641,8 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc." > > (org-copy-face 'modeline 'org-mode-line-clock > "Face used for clock display in mode line.") > +(org-copy-face 'modeline 'org-mode-line-clock-overrun > + "Face used for clock display for overrun tasks in mode line.") > > (provide 'org-faces) > > -- > 1.6.5 -- Google Talk : rileyrgdev@googlemail.com http://www.google.com/talk