diff options
author | Bastien Guerry <bzg@altern.org> | 2012-08-30 16:42:13 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-08-30 16:42:13 +0200 |
commit | cdbc2d4799e2bd48916d53803c0bbae7c095ba66 (patch) | |
tree | 67066a06bed945554290bc9d941ab81eb27dfd90 | |
parent | 43c0ae945efd51cd1517960834dd4dfa7b9ace8d (diff) | |
download | org-mode-cdbc2d4799e2bd48916d53803c0bbae7c095ba66.tar.gz |
Allow using S-<left/right> to update CLOCKSUM from the column view
* org-colview.el (org-columns-next-allowed-value): Add the
CLOCKSUM property to the list of properties that can be
changed interactively from the column view.
* org.el (org-entry-put): Allow to set the CLOCKSUM property
by updating the most recent clock. This is useful in the
column view when you want to use S-<left/right> to update the
last clock of the entry at point.
Thanks to Rainer Stengele who suggested something along those
lines.
-rw-r--r-- | lisp/org-colview.el | 4 | ||||
-rw-r--r-- | lisp/org.el | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 53c3519..423b83a 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -589,9 +589,9 @@ an integer, select that value." (if (= nth -1) (setq nth 9))) (when (equal key "ITEM") (error "Cannot edit item headline from here")) - (unless (or allowed (member key '("SCHEDULED" "DEADLINE"))) + (unless (or allowed (member key '("SCHEDULED" "DEADLINE" "CLOCKSUM"))) (error "Allowed values for this property have not been defined")) - (if (member key '("SCHEDULED" "DEADLINE")) + (if (member key '("SCHEDULED" "DEADLINE" "CLOCKSUM")) (setq nval (if previous 'earlier 'later)) (if previous (setq allowed (reverse allowed))) (cond diff --git a/lisp/org.el b/lisp/org.el index df896a0..d0c2a0c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14747,6 +14747,15 @@ and the new value.") (org-priority (if (and value (stringp value) (string-match "\\S-" value)) (string-to-char value) ?\ )) (org-set-tags nil 'align)) + ((equal property "CLOCKSUM") + (if (not (re-search-forward + (concat org-clock-string "\\]--\\(\\[[^]]+\\]\\)") nil t)) + (error "Cannot find a clock log") + (goto-char (- (match-end 1) 2)) + (cond + ((eq value 'earlier) (org-timestamp-down)) + ((eq value 'later) (org-timestamp-up))) + (org-clock-sum-current-item))) ((equal property "SCHEDULED") (if (re-search-forward org-scheduled-time-regexp end t) (cond |