summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-02-19 10:24:59 +0100
committerBastien Guerry <bzg@altern.org>2013-02-19 10:24:59 +0100
commit19a0b74ce6b84a2cf1f04878030face0601614c4 (patch)
tree680b25609e5569bf5c93ad9f4f25b9d7fe0dccc2
parent33d362788e01b2925fcbdee4bd28309b0fe9f3b2 (diff)
downloadorg-mode-19a0b74ce6b84a2cf1f04878030face0601614c4.tar.gz
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.
-rw-r--r--lisp/org.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 5569c7e..74b71ef 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)