Quellcode durchsuchen

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.
Bastien Guerry vor 12 Jahren
Ursprung
Commit
cdbc2d4799
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 2 2
      lisp/org-colview.el
  2. 9 0
      lisp/org.el

+ 2 - 2
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

+ 9 - 0
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