瀏覽代碼

Show resulting clocked time in agenda display.

Patch by James TD Smith.
Carsten Dominik 16 年之前
父節點
當前提交
bd8cbef200
共有 2 個文件被更改,包括 11 次插入6 次删除
  1. 3 0
      lisp/ChangeLog
  2. 8 6
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2008-09-20  James TD Smith  <ahktenzero@mohorovi.cc>
 2008-09-20  James TD Smith  <ahktenzero@mohorovi.cc>
 
 
+	* org-agenda.el (org-agenda-get-closed): show durations of clocked
+	items as well as the start and end times.
+
 	* org-compat.el (org-get-x-clipboard-compat): Add a compat
 	* org-compat.el (org-get-x-clipboard-compat): Add a compat
 	function for fetching the X clipboard on XEmacs and GNU Emacs 21.
 	function for fetching the X clipboard on XEmacs and GNU Emacs 21.
 
 

+ 8 - 6
lisp/org-agenda.el

@@ -3337,7 +3337,7 @@ the documentation of `org-diary'."
 			    (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
 			    (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
 		    1 11))))
 		    1 11))))
 	 marker hdmarker priority category tags closedp
 	 marker hdmarker priority category tags closedp
-	 ee txt timestr rest)
+	 ee txt timestr rest clocked)
     (goto-char (point-min))
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
     (while (re-search-forward regexp nil t)
       (catch :skip
       (catch :skip
@@ -3353,10 +3353,11 @@ the documentation of `org-diary'."
 	  (setq rest (substring timestr (match-end 0))
 	  (setq rest (substring timestr (match-end 0))
 		timestr (substring timestr 0 (match-end 0)))
 		timestr (substring timestr 0 (match-end 0)))
 	  (if (and (not closedp)
 	  (if (and (not closedp)
-		   (string-match "\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)\\]" rest))
-	      (setq timestr (concat (substring timestr 0 -1)
-				    "-" (match-string 1 rest) "]"))))
-		
+		   (string-match "\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)\\].*\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)" rest))
+	      (progn (setq timestr (concat (substring timestr 0 -1)
+					   "-" (match-string 1 rest) "]"))
+		     (setq clocked (match-string 2 rest)))
+	    (setq clocked "-")))
 	(save-excursion
 	(save-excursion
 	  (if (re-search-backward "^\\*+ " nil t)
 	  (if (re-search-backward "^\\*+ " nil t)
 	      (progn
 	      (progn
@@ -3365,7 +3366,8 @@ the documentation of `org-diary'."
 		      tags (org-get-tags-at))
 		      tags (org-get-tags-at))
 		(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
 		(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
 		(setq txt (org-format-agenda-item
 		(setq txt (org-format-agenda-item
-			   (if closedp "Closed:    " "Clocked:   ")
+			   (if closedp "Closed:    "
+			     (concat "Clocked:   (" clocked  ")"))
 			   (match-string 1) category tags timestr)))
 			   (match-string 1) category tags timestr)))
 	    (setq txt org-agenda-no-heading-message))
 	    (setq txt org-agenda-no-heading-message))
 	  (setq priority 100000)
 	  (setq priority 100000)