From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ippei FURUHASHI Subject: Re: More than one column view in a file Date: Wed, 02 May 2012 06:07:45 +0900 Message-ID: <80r4v3sjtd.fsf@gmail.com> References: <80aa2a75ur.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPKIg-0000Y7-74 for emacs-orgmode@gnu.org; Tue, 01 May 2012 17:07:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPKIc-0007iw-HL for emacs-orgmode@gnu.org; Tue, 01 May 2012 17:07:57 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:51443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPKIc-0007iK-5f for emacs-orgmode@gnu.org; Tue, 01 May 2012 17:07:54 -0400 Received: by pbbrp2 with SMTP id rp2so2895327pbb.0 for ; Tue, 01 May 2012 14:07:52 -0700 (PDT) In-Reply-To: <80aa2a75ur.fsf@somewhere.org> (Sebastien Vauban's message of "Tue, 17 Apr 2012 17:09:16 +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: Sebastien Vauban Cc: emacs-orgmode@gnu.org --=-=-= Hi Sebastien "Sebastien Vauban" writes: > Hello, > > I'd like to have a couple of different (column) views in my Org file, for > example: > > - one (public) view with the estimated time only > - another one (private, I mean "not exported") with the real clocked time My previous patch and this patch cooperate to generate the columnview dynamic block with given columns format. The result for your example is shown below, and I hope you like it. Please regard #+BEGIN line as 1 line, though it seems to be wrapped. #+TITLE: Effort vs Estimate #+AUTHOR: Seb Vauban * Tasks :PROPERTIES: :ID: 49380c04-9b6e-4298-aff8-d936d9679d8e :COLUMNS: %66ITEM(Task) %6Effort(Estim.){:} %6CLOCKSUM(Time) :END: ** TODO A *** TODO A1 :PROPERTIES: :Effort: 12:00 :END: :LOGBOOK: CLOCK: [2012-03-01 Thu 09:00]--[2012-03-01 Thu 17:00] => 8:00 CLOCK: [2012-03-02 Fri 09:00]--[2012-03-02 Fri 17:00] => 8:00 CLOCK: [2012-04-05 Thu 09:00]--[2012-04-05 Thu 12:45] => 3:45 CLOCK: [2012-04-16 Mon 09:00]--[2012-04-16 Mon 14:45] => 5:45 :END: *** TODO A2 :PROPERTIES: :Effort: 24:00 :END: ** TODO B :PROPERTIES: :Effort: 1:00 :END: :LOGBOOK: CLOCK: [2012-03-01 Thu 09:00]--[2012-03-01 Thu 09:30] => 0:30 :END: * Budget estimate We have estimated the budget as follows: #+tblname: dblock-tasks #+BEGIN: columnview :hlines 1 :id "49380c04-9b6e-4298-aff8-d936d9679d8e" :maxlevel 3 :format "%6TODO %66ITEM(Task) %6Effort(Estim.){:}" | TODO | Task | Estim. | |------+---------+--------| | | * Tasks | 37:00 | | TODO | ** A | 36:00 | | TODO | *** A1 | 12:00 | | TODO | *** A2 | 24:00 | | TODO | ** B | 1:00 | #+END: * Worked hours :noexport: We have worked that much, and can compare with what had been estimated: #+tblname: dblock-tasks #+BEGIN: columnview :hlines 1 :id "49380c04-9b6e-4298-aff8-d936d9679d8e" :maxlevel 3 :format "%6TODO %66ITEM(Task) %6Effort(Estim.){:} %6CLOCKSUM(Time)" | TODO | Task | Estim. | Time | |------+---------+--------+-------| | | * Tasks | 37:00 | 26:00 | | TODO | ** A | 36:00 | 25:30 | | TODO | *** A1 | 12:00 | 25:30 | | TODO | *** A2 | 24:00 | | | TODO | ** B | 1:00 | 0:30 | #+END: Best regards, IP --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-org-colview.el-add-new-param-of-format-to-colum.patch >From 50701702a646064034eb4fc718862aa8b7f53bcd Mon Sep 17 00:00:00 2001 From: Ippei FURUHASHI Date: Wed, 2 May 2012 05:23:00 +0900 Subject: [PATCH] lisp/org-colview.el: add new param of format to columnview dblock * lisp/org-colview.el (org-dblock-write:columnview): Add a new param, :format which specifies the column view format to be output as columnview dynamic block. One can generate columnview dynamic block with chosen format: #+BEGIN: columnview :format "%6TODO %66ITEM(Task) %6Effort(Estim.){:}" #+END: TINYCHANGE --- lisp/org-colview.el | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index c7b5d45..d3fb601 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1229,13 +1229,16 @@ (defun org-dblock-write:columnview (params) :vlines When t, make each column a colgroup to enforce vertical lines. :maxlevel When set to a number, don't capture headlines below this level. :skip-empty-rows - When t, skip rows where all specifiers other than ITEM are empty." + When t, skip rows where all specifiers other than ITEM are empty. +:format When a non-nil string like \"%66ITEM(Task) %6Effort(Estim.){:}\", + it specifies the format of column view." (let ((pos (move-marker (make-marker) (point))) (hlines (plist-get params :hlines)) (vlines (plist-get params :vlines)) (maxlevel (plist-get params :maxlevel)) (content-lines (org-split-string (plist-get params :content) "\n")) (skip-empty-rows (plist-get params :skip-empty-rows)) + (columns-fmt (plist-get params :format)) (case-fold-search t) tbl id idpos nfields tmp recalc line id-as-string view-file view-pos) @@ -1265,7 +1268,7 @@ (defun org-dblock-write:columnview (params) (save-restriction (widen) (goto-char (or view-pos (point))) - (org-columns) + (org-columns columns-fmt) (setq tbl (org-columns-capture-view maxlevel skip-empty-rows)) (setq nfields (length (car tbl))) (org-columns-quit)))) -- 1.7.9.msysgit.0 --=-=-=--