From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: increase effort estimate on the fly. Date: Wed, 17 Jun 2009 15:57:33 +0200 Message-ID: <892BA2CE-13DC-4A6C-B15A-6A5958407FDF@gmail.com> References: <61176df0906090242we7696ddue5ba825ff96622e5@mail.gmail.com> 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 1MGve9-0005GZ-Az for emacs-orgmode@gnu.org; Wed, 17 Jun 2009 09:57:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGve4-0005EN-7e for emacs-orgmode@gnu.org; Wed, 17 Jun 2009 09:57:48 -0400 Received: from [199.232.76.173] (port=34453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGve3-0005ED-VA for emacs-orgmode@gnu.org; Wed, 17 Jun 2009 09:57:44 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:46572) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGve1-0008J2-IJ for emacs-orgmode@gnu.org; Wed, 17 Jun 2009 09:57:43 -0400 Received: by ewy6 with SMTP id 6so500945ewy.42 for ; Wed, 17 Jun 2009 06:57:36 -0700 (PDT) In-Reply-To: <61176df0906090242we7696ddue5ba825ff96622e5@mail.gmail.com> 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: Konstantin Antipin Cc: emacs-orgmode mailing list Hi Konstantin, I have added this functionality, but without the global key binding. Thanks! - Carsten On Jun 9, 2009, at 11:42 AM, Konstantin Antipin wrote: > Dear all, > > Recently new feature was added - when you set an estimated effort for > a task, you can be notified when time is up. > (sound is controlled with org-clock-sound variable) > I found that pretty often from the beginning I can not correctly > estimate what time task will take and I need to give myself an > additional time. > > To address this issue I wrote couple of functions that helps me with > that. > What do they do: > When you have clocked item and want to add time (increase effort > estimate), you call function org-clock-increase-effort-estimate, which > will ask you for a time period. It will update update currently > clocked item in a buffer as well as a mode line. > > I hope this might be helpful to someone > > Kostya > > defun org-clock-increase-effort-estimate (add-effort) > "Add time to the effort estimate. > Update Effort property of currently clocked item. > Update mode line." > (interactive "sHow much to add? (hh:mm or mm)? ") > (if (and (org-clock-is-active) org-clock-effort) > (let ((add-effort-minutes (org-string-to-minutes add-effort))) > (progn (setq org-clock-effort (org-minutes-to-hh:mm-string > (+ add-effort-minutes > (org-hh:mm-string-to-minutes org-clock-effort)))) > (org-clock-update-mode-line) > (message "about to increase effort.") > (org-clock-set-effort-estimate-in-buffer org-clock-effort) > ) > )) > ) > > (defun org-clock-set-effort-estimate-in-buffer (effort-string) > "Increase effort estimate PROPERTY for the currently clocked item. > Jump to the correct buffer, increace the PROPERTY, jump back." > (if (org-clock-is-active) > (progn > (let ((back-mark (point-marker))) > (org-clock-goto) > (org-set-property "Effort" effort-string) > (switch-to-buffer (marker-buffer back-mark)) > (goto-char back-mark) > (message "Effort was increased.") > )))) > > > > (defun org-string-to-minutes (string) > "Recognizes two formats: > 1:30 - converted to minutes > 30 - interpreted as minutes." > (case (length (split-string string ":")) > (2 (org-hh:mm-string-to-minutes string)) > (1 (string-to-int string)) > ) > ) > > (defun org-clock-is-active () > "Return true if clock is currently running. > nil otherwise." > (if (marker-buffer org-clock-marker) > t) > ) > > > ;; Suggested bindings > (org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-increase-effort- > estimate) > (global-set-key "\C-c\C-x\C-e" 'org-clock-increase-effort-estimate) > > > _______________________________________________ > 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