From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: Re: Effort estimates on repeating tasks Date: Thu, 03 Oct 2019 22:07:01 +0200 Message-ID: <87lfu1r3tm.fsf@pc-117-162.i-did-not-set--mail-host-address--so-tickle-me> References: <87a7b0rs81.fsf@pc-117-162.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iG7O0-0007Yr-Qg for emacs-orgmode@gnu.org; Thu, 03 Oct 2019 16:07:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iG7Nz-0007AZ-GX for emacs-orgmode@gnu.org; Thu, 03 Oct 2019 16:07:40 -0400 Received: from 5.mo177.mail-out.ovh.net ([46.105.39.154]:45238) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iG7Ng-0006vM-5X for emacs-orgmode@gnu.org; Thu, 03 Oct 2019 16:07:39 -0400 Received: from player692.ha.ovh.net (unknown [10.108.35.197]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id A683310C9E7 for ; Thu, 3 Oct 2019 22:07:10 +0200 (CEST) In-Reply-To: <87a7b0rs81.fsf@pc-117-162.i-did-not-set--mail-host-address--so-tickle-me> (garjola@garjola.net's message of "Thu, 19 Sep 2019 21:39:10 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode On Thu 19-Sep-2019 at 21:39:10 +02, garjola@garjola.net wrote:=20 > Hi, > > I like the warning in the mode line when the time clocked on a task goes > beyond the effort estimates in the properties drawer. > > However, I don=E2=80=99t know how to use this for repeating tasks or habi= ts. > That is, I want to work on a given task every day for less than N > minutes and be warned when going beyond this amount. Of course, > using the Effort property will warn me the first time, but will be > useless after that, unless I delete the clocked time at the beginning of > each new session. > > Is there a way to do that properly? > > Thanks in advance for your help. > > G. Hi, I have been investigating this and I think I could advice org-clock-get-clo= ck-string. I have never written advices to functions and I don=E2=80=99t kn= ow org=E2=80=99s API. Since I want to change the clock string only for repeating tasks, I have do= ne this, which just adds =E2=80=9CRepeating=E2=80=9D to the clock string wh= en clocking a repeating task: #+BEGIN_SRC emacs-lisp (defun ocgcs (orig-fun &rest args) "Advice for effort in repeating tasks" (progn (if (org-entry-get (point) "LAST_REPEAT") (concat "Repeating"=20 (apply orig-fun args)) (apply orig-fun args)))) (advice-add 'org-clock-get-clock-string :around #'ocgcs) #+END_SRC What I would like to do now is getting the total time clocked today for the= task and then compare it to the Effot property value. I have found how to = get the total amount of time clocked for the task, but I don=E2=80=99t know= how to limit this to today. Any ideas? Thank you. G.