From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Date-centric Clocktable Date: Wed, 07 Sep 2011 12:56:33 +0200 Message-ID: <87obywr57i.fsf@gmail.com> References: <87zkip7oc6.fsf@gmail.com> <87mxegenfh.fsf@rat.lan> <87d3fcsoqf.fsf@gmail.com> <871uvsejxp.fsf@rat.lan> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1FmU-0001vW-Sl for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:54:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1FmT-00025M-JG for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:54:58 -0400 Received: from lo.gmane.org ([80.91.229.12]:52491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1FmT-00024v-6w for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 06:54:57 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R1FmP-0005FW-8C for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 12:54:53 +0200 Received: from 0x555293e1.adsl.cybercity.dk ([85.82.147.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2011 12:54:53 +0200 Received: from rasmus by 0x555293e1.adsl.cybercity.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Sep 2011 12:54:53 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Olaf Dietsche writes: > If you insist on elisp, maybe something along these (untested) lines > might work: It just nicer to do text stuff from within Emacs but my personal Lisp skill are surpassed by my Python skills. That is not to say that any of the skill sets are high. . . The function didn't work in my test.org in emacs -q. I will investigate more later when I've got more time. > ---8<--- cut here --- > (defvar clockstable) > > (defun collect-clock-lines () > (org-narrow-to-subtree) > (let ((re (concat "^[ \t]*" org-clock-string "[ \t]+\\(.+?\\)[ \t]+=>[ \t]+\\(.+\\)")) > (headline (nth 4 (org-heading-components)))) > (while (re-search-forward re) > (setq clockstable (concat clockstable (match-string 1) "|" headline "|" (match-string 2) "\n"))))) > > (defun summarize-clocks () > (interactive) > (setq clockstable "| date | headline | total |\n|-----+----+----|\n") > (org-map-entries collect-clock-lines nil 'agenda) > (insert clockstable)) > --- cut here --->8--- Thanks again, Rasmus -- Sent from my Emacs