From 19a0b74ce6b84a2cf1f04878030face0601614c4 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 19 Feb 2013 10:24:59 +0100 Subject: [PATCH] org.el (org-set-effort, org-property-next-allowed-value): When needed, update the current clock effort time * org.el (org-set-effort, org-property-next-allowed-value): When needed, update the current clock effort time. --- lisp/org.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 5569c7e16..74b71ef67 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14679,6 +14679,7 @@ When INCREMENT is non-nil, set the property to the next allowed value." (cur (org-entry-get nil prop)) (allowed (org-property-get-allowed-values nil prop 'table)) (existing (mapcar 'list (org-property-values prop))) + (heading (nth 4 (org-heading-components))) rpl (val (cond ((stringp value) value) @@ -14712,6 +14713,9 @@ When INCREMENT is non-nil, set the property to the next allowed value." (save-excursion (org-back-to-heading t) (put-text-property (point-at-bol) (point-at-eol) 'org-effort val)) + (when (string= heading org-clock-current-task) + (setq org-clock-effort (get-text-property (point-at-bol) 'org-effort)) + (org-clock-update-mode-line)) (message "%s is now %s" prop val))) (defun org-at-property-p () @@ -15473,6 +15477,7 @@ completion." (allowed (or (org-property-get-allowed-values (point) key) (and (member value '("[ ]" "[-]" "[X]")) '("[ ]" "[X]")))) + (heading (save-match-data (nth 4 (org-heading-components)))) nval) (unless allowed (error "Allowed values for this property have not been defined")) @@ -15490,7 +15495,10 @@ completion." (when (equal prop org-effort-property) (save-excursion (org-back-to-heading t) - (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval))) + (put-text-property (point-at-bol) (point-at-eol) 'org-effort nval)) + (when (string= org-clock-current-task heading) + (setq org-clock-effort nval) + (org-clock-update-mode-line))) (run-hook-with-args 'org-property-changed-functions key nval))) (defun org-find-olp (path &optional this-buffer) -- 2.11.4.GIT