From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: [PATCH 3/9] Show durations of clocked times in timeline Date: Sat, 20 Sep 2008 22:08:56 +0100 Message-ID: <20080920210856.19759.99271.stgit@nyarlathotep.internal.mohorovi.cc> References: <20080920210101.19759.15959.stgit@nyarlathotep.internal.mohorovi.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kh9hN-00046t-1c for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kh9hL-000468-Ed for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:09:00 -0400 Received: from [199.232.76.173] (port=60158 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kh9hL-000464-48 for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:08:59 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:60885 helo=yog-sothoth.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kh9hK-00023o-HQ for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 17:08:58 -0400 Received: from nyarlathotep.internal.mohorovi.cc (Debian-exim@nyarlathotep.internal.mohorovi.cc [10.0.0.5]) by yog-sothoth.mohorovi.cc (8.14.2/8.14.2) with ESMTP id m8KL8ubO017656 for ; Sat, 20 Sep 2008 22:08:56 +0100 (BST) (envelope-from ahktenzero@mohorovi.cc) Received: from [127.0.0.1] (helo=nyarlathotep.internal.mohorovi.cc ident=ahktenzero) by nyarlathotep.internal.mohorovi.cc with esmtp (Exim 4.69) (envelope-from ) id 1Kh9hI-0005of-JD for emacs-orgmode@gnu.org; Sat, 20 Sep 2008 22:08:56 +0100 In-Reply-To: <20080920210101.19759.15959.stgit@nyarlathotep.internal.mohorovi.cc> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org In the timeline display in the agenda, show the length of time clocked as well as the start and end times. --- lisp/ChangeLog | 3 +++ lisp/org-agenda.el | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bcefdab..3896ddf 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-09-20 James TD Smith + * 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 function for fetching the X clipboard on XEmacs and GNU Emacs 21. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d1abcce..f13002e 100644 --- a/lisp/org-agenda.el +++ b/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)))) 1 11)))) marker hdmarker priority category tags closedp - ee txt timestr rest) + ee txt timestr rest clocked) (goto-char (point-min)) (while (re-search-forward regexp nil t) (catch :skip @@ -3353,10 +3353,11 @@ the documentation of `org-diary'." (setq rest (substring timestr (match-end 0)) timestr (substring timestr 0 (match-end 0))) (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 (if (re-search-backward "^\\*+ " nil t) (progn @@ -3365,7 +3366,8 @@ the documentation of `org-diary'." tags (org-get-tags-at)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq txt (org-format-agenda-item - (if closedp "Closed: " "Clocked: ") + (if closedp "Closed: " + (concat "Clocked: (" clocked ")")) (match-string 1) category tags timestr))) (setq txt org-agenda-no-heading-message)) (setq priority 100000)