emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Effort estimates on repeating tasks
@ 2019-09-19 19:39 garjola
  2019-10-03 20:07 ` garjola
  0 siblings, 1 reply; 2+ messages in thread
From: garjola @ 2019-09-19 19:39 UTC (permalink / raw)
  To: emacs-orgmode

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’t know how to use this for repeating tasks or habits.
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.
-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Effort estimates on repeating tasks
  2019-09-19 19:39 Effort estimates on repeating tasks garjola
@ 2019-10-03 20:07 ` garjola
  0 siblings, 0 replies; 2+ messages in thread
From: garjola @ 2019-10-03 20:07 UTC (permalink / raw)
  To: emacs-orgmode

On Thu 19-Sep-2019 at 21:39:10 +02, garjola@garjola.net wrote: 
> 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’t know how to use this for repeating tasks or habits.
> 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-clock-string. I have never written advices to functions and I don’t know org’s API.

Since I want to change the clock string only for repeating tasks, I have done this, which just adds “Repeating” to the clock string when 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" 
                (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’t know how to limit this to today.

Any ideas?

Thank you.

G.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-03 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 19:39 Effort estimates on repeating tasks garjola
2019-10-03 20:07 ` garjola

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