From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Dietsche Subject: Re: Date-centric Clocktable Date: Wed, 07 Sep 2011 13:30:55 +0200 Message-ID: <87wrdkd1xs.fsf@rat.lan> References: <87zkip7oc6.fsf@gmail.com> <87mxegenfh.fsf@rat.lan> <87d3fcsoqf.fsf@gmail.com> <871uvsejxp.fsf@rat.lan> <87obywr57i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1GLY-0003s7-CP for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 07:31:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1GLS-0008Nl-D3 for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 07:31:12 -0400 Received: from www85.your-server.de ([213.133.104.85]:48725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1GLR-0008NW-VF for emacs-orgmode@gnu.org; Wed, 07 Sep 2011 07:31:06 -0400 In-Reply-To: <87obywr57i.fsf@gmail.com> (rasmus@gmx.us's message of "Wed, 07 Sep 2011 12:56:33 +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: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: > 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--- Look at C-h f org-map-entries RET. Maybe changing the scope from 'agenda to 'file will help. Regards, Olaf