* lisp/org-clock.el: Add param :properties to list properties in clocktable
@ 2011-03-26 20:29 Niels Giesen
2011-03-26 20:49 ` Bernt Hansen
2011-05-02 9:33 ` Carsten Dominik
0 siblings, 2 replies; 14+ messages in thread
From: Niels Giesen @ 2011-03-26 20:29 UTC (permalink / raw)
To: emacs-orgmode
Here are a few patches to add property columns in clocktables. These
allow me e.g. to freely set different cost centers which is wanted @
my work, and also possibly small descriptions. It is generically set
up so I reckon other people may find use in this too.
The patches together add two parameters to the dynamic block line:
: :properties ("prop-this" "prop-other") :inherit-props t
The property columns will be added at the left side of the existing
columns; I did experiment with adding them to the right, but because
of the variable number of levels (being defined both by :maxlevel and
the actual number of found levels), that did not work out well.
I used the parameter =:inherit-props= to set inheritance for
properties, as I have learned in the past that
=org-use-property-inheritance= should be used very sparingly.
#+begin_src diff
From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
From: Niels Giesen <niels.giesen@gmail.com>
Date: Sat, 26 Mar 2011 10:19:08 +0100
Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
This param should be a list of strings referring to properties. Those
properties will be returned in an alist when found in an entry.
---
lisp/org-clock.el | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c567a26..df096d1 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
;;; org-clock.el --- The time clocking code for Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
@@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(block (plist-get params :block))
(link (plist-get params :link))
(tags (plist-get params :tags))
+ (properties (plist-get params :properties))
(matcher (if tags (cdr (org-make-tags-matcher tags))))
cc range-text st p time level hdl props tsp tbl)
@@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(or (cdr (assoc "SCHEDULED" props))
(cdr (assoc "DEADLINE" props))
(cdr (assoc "TIMESTAMP" props))
- (cdr (assoc "TIMESTAMP_IA" props)))))
- (when (> time 0) (push (list level hdl tsp time) tbl))))))
+ (cdr (assoc "TIMESTAMP_IA" props))))
+ props (when properties
+ (remove nil
+ (mapcar
+ (lambda (p)
+ (when (org-entry-get (point) p)
+ (cons p (org-entry-get (point) p))))
+ properties))))
+ (when (> time 0) (push (list level hdl tsp time props) tbl))))))
(setq tbl (nreverse tbl))
(list file org-clock-file-total-minutes tbl))))
--
1.7.1
#+end_src
#+begin_src diff
From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
From: Niels Giesen <niels.giesen@gmail.com>
Date: Sat, 26 Mar 2011 11:05:33 +0100
Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
Each property specified in properties will get a column in the clocktable.
---
lisp/org-clock.el | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index df096d1..a330db0 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2052,6 +2052,7 @@ from the dynamic block defintion."
(emph (plist-get params :emphasize))
(level-p (plist-get params :level))
(timestamp (plist-get params :timestamp))
+ (properties (plist-get params :properties))
(ntcol (max 1 (or (plist-get params :tcolumns) 100)))
(rm-file-column (plist-get params :one-file-with-archives))
(indent (plist-get params :indent))
@@ -2115,6 +2116,7 @@ from the dynamic block defintion."
(if multifile "|" "") ; file column, maybe
(if level-p "|" "") ; level column, maybe
(if timestamp "|" "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(format "<%d>| |\n" narrow))) ; headline and time columns
;; Insert the table header line
@@ -2123,6 +2125,7 @@ from the dynamic block defintion."
(if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
(if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
(if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
+ (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
(concat (nth 4 lwords) "|"
(nth 5 lwords) "|\n")) ; headline and time columns
@@ -2134,6 +2137,7 @@ from the dynamic block defintion."
; file column, maybe
(if level-p "|" "") ; level column, maybe
(if timestamp "|" "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(concat "*" (nth 7 lwords) "*| ") ; instead of a headline
"*"
(org-minutes-to-hh:mm-string (or total-time 0)) ; the time
@@ -2157,6 +2161,7 @@ from the dynamic block defintion."
(file-name-nondirectory (car tbl))
(if level-p "| " "") ; level column, maybe
(if timestamp "| " "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
;; Get the list of node entries and iterate over it
@@ -2181,6 +2186,11 @@ from the dynamic block defintion."
(if multifile "|" "") ; free space for file name column?
(if level-p (format "%d|" (car entry)) "") ; level, maybe
(if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
+ (if properties
+ (concat
+ (mapconcat
+ (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
+ properties "|") "|") "") ;properties columns, maybe
(if indent (org-clocktable-indent-string level) "") ; indentation
hlc headline hlc "|" ; headline
(make-string (min (1- ntcol) (or (- level 1))) ?|)
--
1.7.1
#+end_src
#+begin_src diff
From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
From: Niels Giesen <niels.giesen@gmail.com>
Date: Sat, 26 Mar 2011 14:48:21 +0100
Subject: [PATCH 3/3] org-clock: Add param :inherit-props
When non-nil, properties are computed with inheritance.
---
lisp/org-clock.el | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index a330db0..1eecb68 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(link (plist-get params :link))
(tags (plist-get params :tags))
(properties (plist-get params :properties))
+ (inherit-property-p (plist-get params :inherit-props))
(matcher (if tags (cdr (org-make-tags-matcher tags))))
cc range-text st p time level hdl props tsp tbl)
@@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(remove nil
(mapcar
(lambda (p)
- (when (org-entry-get (point) p)
- (cons p (org-entry-get (point) p))))
+ (when (org-entry-get (point) p inherit-property-p)
+ (cons p (org-entry-get (point) p inherit-property-p))))
properties))))
(when (> time 0) (push (list level hdl tsp time props) tbl))))))
(setq tbl (nreverse tbl))
--
1.7.1
#+end_src
niels
--
http://pft.github.com
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-03-26 20:29 lisp/org-clock.el: Add param :properties to list properties in clocktable Niels Giesen
@ 2011-03-26 20:49 ` Bernt Hansen
2011-03-27 10:13 ` Niels Giesen
2011-05-02 9:33 ` Carsten Dominik
1 sibling, 1 reply; 14+ messages in thread
From: Bernt Hansen @ 2011-03-26 20:49 UTC (permalink / raw)
To: Niels Giesen; +Cc: emacs-orgmode
Niels Giesen <niels.giesen@gmail.com> writes:
> Here are a few patches to add property columns in clocktables. These
> allow me e.g. to freely set different cost centers which is wanted @
> my work, and also possibly small descriptions. It is generically set
> up so I reckon other people may find use in this too.
>
> The patches together add two parameters to the dynamic block line:
>
> : :properties ("prop-this" "prop-other") :inherit-props t
>
> The property columns will be added at the left side of the existing
> columns; I did experiment with adding them to the right, but because
> of the variable number of levels (being defined both by :maxlevel and
> the actual number of found levels), that did not work out well.
>
> I used the parameter =:inherit-props= to set inheritance for
> properties, as I have learned in the past that
> =org-use-property-inheritance= should be used very sparingly.
>
Hi Niels,
Could you provide a sample clock report using this patch to get a
better idea of why you find this useful?
Thanks,
--
Bernt
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-03-26 20:49 ` Bernt Hansen
@ 2011-03-27 10:13 ` Niels Giesen
2011-03-27 12:13 ` Bernt Hansen
0 siblings, 1 reply; 14+ messages in thread
From: Niels Giesen @ 2011-03-27 10:13 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode
Bernt Hansen <bernt@norang.ca> writes:
[...]
> Could you provide a sample clock report using this patch to get a
> better idea of why you find this useful?
Yes, here you are, along with the contents of a sample file, so that you
may get a gist of my need for inheritance.
* Clocktables
#+BEGIN: clocktable :maxlevel 2 :scope file :properties ("Costcenter" "Billable") :inherit-props t
Clock summary at [2011-03-27 Sun 12:04]
| Costcenter | Billable | Headline | Time | |
|-----------------------------------+----------+---------------------------------+--------+------|
| | | *Total time* | *3:08* | |
|-----------------------------------+----------+---------------------------------+--------+------|
| A-102: General Administration | | TODO Travel cost declaration | 0:42 | |
| A-102: General Administration | | TODO December 2007-2009 | | 0:37 |
| O-100: General overhead | | Making coffee for the lot of us | 0:06 | |
| C-100: Customer relations general | | Helpdesk | 1:10 | |
| C-100: Customer relations general | | Categorize our helpdesk e-mails | | 0:20 |
| C-101: Customer A | [X] | Help out customer a | | 0:10 |
| C-102: Customer B | [?] | Help out customer b on issue x | | 0:20 |
| C-100: Customer relations general | | Help out potential customer c | | 0:20 |
| W-100: Web Development | | Develop our main web app | 1:10 | |
| W-100: Web Development | | that | | 0:41 |
| C-102: Customer B | [?] | something only customer b wants | | 0:29 |
#+END:
Actually, my boss needs something more like the table below, which I
can export to something that Outlook Times also spits out (some
clocking plugin for MS Outlook that the rest of us uses, and I was
supposed to use too, you may understand that that is just a silly idea
for someone used to org-mode).
Patches 1 and 3 allowed me to get this specific output using a custom
formatter and a #+TBLFM: line, which I may post to Worg if people are
interested.
#+BEGIN: clocktable :formatter org-clocktable-write-outlook-times-style :maxlevel 2 :scope file :inherit-props t :properties ("Costcenter" "Billable") :date t :block day
Clock summary at [2011-03-27 Sun 12:04], for Sunday, March 27, 2011.
| Date | Headline | Time | Costcenter | Billable |
|------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
| | *Total time* | *3.05* | | |
|------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
| 27-03-2011 | TODO Travel cost declaration | 0.00 | A-102: General Administration | |
| 27-03-2011 | TODO Travel cost declaration, TODO December 2007-2009 | 0.62 | A-102: General Administration | |
|------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
| 27-03-2011 | Making coffee for the lot of us | 0.10 | O-100: General overhead | |
|------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
| 27-03-2011 | Helpdesk | 0.00 | C-100: Customer relations general | |
| 27-03-2011 | Helpdesk, Categorize our helpdesk e-mails | 0.33 | C-100: Customer relations general | |
| 27-03-2011 | Helpdesk, Help out customer a | 0.17 | C-101: Customer A | [X] |
| 27-03-2011 | Helpdesk, Help out customer b on issue x | 0.33 | C-102: Customer B | [?] |
| 27-03-2011 | Helpdesk, Help out potential customer c | 0.33 | C-100: Customer relations general | |
|------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
| 27-03-2011 | Develop our main web app | 0.00 | W-100: Web Development | |
| 27-03-2011 | Develop our main web app, that | 0.68 | W-100: Web Development | |
| 27-03-2011 | Develop our main web app, something only customer b wants | 0.48 | C-102: Customer B | [?] |
#+TBLFM: $2='(if (string= "$0" "@-I") "$0" (concat "@-I" ", " "$0"));L::$4='(if (string= "$0" "") "@-I" "$0");L
#+END:
* TODO Travel cost declaration
DEADLINE: <2011-04-01 vr .+1m>
- State "DONE" from "TESTING" [2011-02-01 di 10:02]
:LOGBOOK:
CLOCK: [2011-03-02 wo 09:17]--[2011-03-02 wo 09:22] => 0:05
:END:
- State "DONE" from "TESTING" [2011-01-04 di 09:40]
:PROPERTIES:
:COSTCENTER: A-102: General Administration
:END:
** TODO December 2007-2009
:CLOCK:
CLOCK: [2011-03-27 Sun 09:28]--[2011-03-27 Sun 10:05] => 0:37
:END:
Find out what were my costs during this hazy period of my life.
* Dishes :daily:
:PROPERTIES:
:COSTCENTER: O-100: General overhead
:END:
* Making coffee for the lot of us :daily:
:CLOCK:
CLOCK: [2011-03-27 Sun 09:22]--[2011-03-27 Sun 09:28] => 0:06
:END:
:PROPERTIES:
:COSTCENTER: O-100: General overhead
:END:
* Helpdesk
:PROPERTIES:
:COSTCENTER: C-100: Customer relations general
:END:
** Categorize our helpdesk e-mails :daily:
:CLOCK:
CLOCK: [2011-03-27 Sun 10:05]--[2011-03-27 Sun 10:25] => 0:20
:END:
** Help out customer a
:CLOCK:
CLOCK: [2011-03-27 Sun 10:25]--[2011-03-27 Sun 10:35] => 0:10
:END:
:PROPERTIES:
:COSTCENTER: C-101: Customer A
:BILLABLE: [X]
:END:
** Help out customer b on issue x
:CLOCK:
CLOCK: [2011-03-27 Sun 10:35]--[2011-03-27 Sun 10:55] => 0:20
:END:
:PROPERTIES:
:COSTCENTER: C-102: Customer B
:BILLABLE: [?]
:END:
** Help out potential customer c
:CLOCK:
CLOCK: [2011-03-27 Sun 10:55]--[2011-03-27 Sun 11:15] => 0:20
:END:
Does not yet have a cost center
* Develop our main web app
:PROPERTIES:
:COSTCENTER: W-100: Web Development
:END:
** this
** that
:CLOCK:
CLOCK: [2011-03-27 Sun 11:44]--[2011-03-27 Sun 12:25] => 0:45
:END:
** something only customer b wants
:CLOCK:
CLOCK: [2011-03-27 Sun 11:15]--[2011-03-27 Sun 11:44] => 0:29
:END:
:PROPERTIES:
:COSTCENTER: C-102: Customer B
:BILLABLE: [?]
:END:
>
> Thanks,
--
http://pft.github.com/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-03-27 10:13 ` Niels Giesen
@ 2011-03-27 12:13 ` Bernt Hansen
2011-03-28 18:24 ` Niels Giesen
0 siblings, 1 reply; 14+ messages in thread
From: Bernt Hansen @ 2011-03-27 12:13 UTC (permalink / raw)
To: Niels Giesen; +Cc: emacs-orgmode
Niels Giesen <niels.giesen@gmail.com> writes:
> Bernt Hansen <bernt@norang.ca> writes:
>
> [...]
>
>> Could you provide a sample clock report using this patch to get a
>> better idea of why you find this useful?
>
> Yes, here you are, along with the contents of a sample file, so that you
> may get a gist of my need for inheritance.
>
> * Clocktables
> #+BEGIN: clocktable :maxlevel 2 :scope file :properties ("Costcenter" "Billable") :inherit-props t
> Clock summary at [2011-03-27 Sun 12:04]
>
> | Costcenter | Billable | Headline | Time | |
> |-----------------------------------+----------+---------------------------------+--------+------|
> | | | *Total time* | *3:08* | |
> |-----------------------------------+----------+---------------------------------+--------+------|
> | A-102: General Administration | | TODO Travel cost declaration | 0:42 | |
> | A-102: General Administration | | TODO December 2007-2009 | | 0:37 |
> | O-100: General overhead | | Making coffee for the lot of us | 0:06 | |
> | C-100: Customer relations general | | Helpdesk | 1:10 | |
> | C-100: Customer relations general | | Categorize our helpdesk e-mails | | 0:20 |
> | C-101: Customer A | [X] | Help out customer a | | 0:10 |
> | C-102: Customer B | [?] | Help out customer b on issue x | | 0:20 |
> | C-100: Customer relations general | | Help out potential customer c | | 0:20 |
> | W-100: Web Development | | Develop our main web app | 1:10 | |
> | W-100: Web Development | | that | | 0:41 |
> | C-102: Customer B | [?] | something only customer b wants | | 0:29 |
> #+END:
>
> Actually, my boss needs something more like the table below, which I
> can export to something that Outlook Times also spits out (some
> clocking plugin for MS Outlook that the rest of us uses, and I was
> supposed to use too, you may understand that that is just a silly idea
> for someone used to org-mode).
>
> Patches 1 and 3 allowed me to get this specific output using a custom
> formatter and a #+TBLFM: line, which I may post to Worg if people are
> interested.
>
> #+BEGIN: clocktable :formatter org-clocktable-write-outlook-times-style :maxlevel 2 :scope file :inherit-props t :properties ("Costcenter" "Billable") :date t :block day
> Clock summary at [2011-03-27 Sun 12:04], for Sunday, March 27, 2011.
>
> | Date | Headline | Time | Costcenter | Billable |
> |------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
> | | *Total time* | *3.05* | | |
> |------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
> | 27-03-2011 | TODO Travel cost declaration | 0.00 | A-102: General Administration | |
> | 27-03-2011 | TODO Travel cost declaration, TODO December 2007-2009 | 0.62 | A-102: General Administration | |
> |------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
> | 27-03-2011 | Making coffee for the lot of us | 0.10 | O-100: General overhead | |
> |------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
> | 27-03-2011 | Helpdesk | 0.00 | C-100: Customer relations general | |
> | 27-03-2011 | Helpdesk, Categorize our helpdesk e-mails | 0.33 | C-100: Customer relations general | |
> | 27-03-2011 | Helpdesk, Help out customer a | 0.17 | C-101: Customer A | [X] |
> | 27-03-2011 | Helpdesk, Help out customer b on issue x | 0.33 | C-102: Customer B | [?] |
> | 27-03-2011 | Helpdesk, Help out potential customer c | 0.33 | C-100: Customer relations general | |
> |------------+-----------------------------------------------------------+--------+-----------------------------------+----------|
> | 27-03-2011 | Develop our main web app | 0.00 | W-100: Web Development | |
> | 27-03-2011 | Develop our main web app, that | 0.68 | W-100: Web Development | |
> | 27-03-2011 | Develop our main web app, something only customer b wants | 0.48 | C-102: Customer B | [?] |
> #+TBLFM: $2='(if (string= "$0" "@-I") "$0" (concat "@-I" ", " "$0"));L::$4='(if (string= "$0" "") "@-I" "$0");L
> #+END:
> * TODO Travel cost declaration
> DEADLINE: <2011-04-01 vr .+1m>
> - State "DONE" from "TESTING" [2011-02-01 di 10:02]
> :LOGBOOK:
> CLOCK: [2011-03-02 wo 09:17]--[2011-03-02 wo 09:22] => 0:05
> :END:
> - State "DONE" from "TESTING" [2011-01-04 di 09:40]
> :PROPERTIES:
> :COSTCENTER: A-102: General Administration
> :END:
> ** TODO December 2007-2009
> :CLOCK:
> CLOCK: [2011-03-27 Sun 09:28]--[2011-03-27 Sun 10:05] => 0:37
> :END:
> Find out what were my costs during this hazy period of my life.
Hi Niels,
Thanks for the example. That helps a lot. I think posting this to Worg
would be very useful.
Thanks for sharing this!
Regards,
--
Bernt
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-03-27 12:13 ` Bernt Hansen
@ 2011-03-28 18:24 ` Niels Giesen
0 siblings, 0 replies; 14+ messages in thread
From: Niels Giesen @ 2011-03-28 18:24 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode
> Bernt Hansen <bernt@norang.ca> writes:
> Thanks for the example. That helps a lot. I think posting this to Worg
> would be very useful.
Hi Bernt, I will do so if/when these patches get accepted ;)
--
http://pft.github.com/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-03-26 20:29 lisp/org-clock.el: Add param :properties to list properties in clocktable Niels Giesen
2011-03-26 20:49 ` Bernt Hansen
@ 2011-05-02 9:33 ` Carsten Dominik
2011-05-13 8:00 ` Niels Giesen
1 sibling, 1 reply; 14+ messages in thread
From: Carsten Dominik @ 2011-05-02 9:33 UTC (permalink / raw)
To: Niels Giesen; +Cc: Bernt Hansen, emacs-orgmode list
Dear Niels,
I am confused by the three patch pieces applied to the same file.
Can you please resubmit, with a single patch, and a proper
changelog-like entry?
Thanks.
- Carsten
On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
>
> Here are a few patches to add property columns in clocktables. These
> allow me e.g. to freely set different cost centers which is wanted @
> my work, and also possibly small descriptions. It is generically set
> up so I reckon other people may find use in this too.
>
> The patches together add two parameters to the dynamic block line:
>
> : :properties ("prop-this" "prop-other") :inherit-props t
>
> The property columns will be added at the left side of the existing
> columns; I did experiment with adding them to the right, but because
> of the variable number of levels (being defined both by :maxlevel and
> the actual number of found levels), that did not work out well.
>
> I used the parameter =:inherit-props= to set inheritance for
> properties, as I have learned in the past that
> =org-use-property-inheritance= should be used very sparingly.
>
> #+begin_src diff
> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
> From: Niels Giesen <niels.giesen@gmail.com>
> Date: Sat, 26 Mar 2011 10:19:08 +0100
> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
>
> This param should be a list of strings referring to properties. Those
> properties will be returned in an alist when found in an entry.
> ---
> lisp/org-clock.el | 14 +++++++++++---
> 1 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index c567a26..df096d1 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -1,6 +1,6 @@
> ;;; org-clock.el --- The time clocking code for Org-mode
>
> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
> ;; Free Software Foundation, Inc.
>
> ;; Author: Carsten Dominik <carsten at orgmode dot org>
> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (block (plist-get params :block))
> (link (plist-get params :link))
> (tags (plist-get params :tags))
> + (properties (plist-get params :properties))
> (matcher (if tags (cdr (org-make-tags-matcher tags))))
> cc range-text st p time level hdl props tsp tbl)
>
> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (or (cdr (assoc "SCHEDULED" props))
> (cdr (assoc "DEADLINE" props))
> (cdr (assoc "TIMESTAMP" props))
> - (cdr (assoc "TIMESTAMP_IA" props)))))
> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
> + (cdr (assoc "TIMESTAMP_IA" props))))
> + props (when properties
> + (remove nil
> + (mapcar
> + (lambda (p)
> + (when (org-entry-get (point) p)
> + (cons p (org-entry-get (point) p))))
> + properties))))
> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
> (setq tbl (nreverse tbl))
> (list file org-clock-file-total-minutes tbl))))
>
> --
> 1.7.1
> #+end_src
>
> #+begin_src diff
> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
> From: Niels Giesen <niels.giesen@gmail.com>
> Date: Sat, 26 Mar 2011 11:05:33 +0100
> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
>
> Each property specified in properties will get a column in the clocktable.
> ---
> lisp/org-clock.el | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index df096d1..a330db0 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
> (emph (plist-get params :emphasize))
> (level-p (plist-get params :level))
> (timestamp (plist-get params :timestamp))
> + (properties (plist-get params :properties))
> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
> (rm-file-column (plist-get params :one-file-with-archives))
> (indent (plist-get params :indent))
> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
> (if multifile "|" "") ; file column, maybe
> (if level-p "|" "") ; level column, maybe
> (if timestamp "|" "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (format "<%d>| |\n" narrow))) ; headline and time columns
>
> ;; Insert the table header line
> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
> (concat (nth 4 lwords) "|"
> (nth 5 lwords) "|\n")) ; headline and time columns
>
> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
> ; file column, maybe
> (if level-p "|" "") ; level column, maybe
> (if timestamp "|" "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
> "*"
> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
> (file-name-nondirectory (car tbl))
> (if level-p "| " "") ; level column, maybe
> (if timestamp "| " "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>
> ;; Get the list of node entries and iterate over it
> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
> (if multifile "|" "") ; free space for file name column?
> (if level-p (format "%d|" (car entry)) "") ; level, maybe
> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
> + (if properties
> + (concat
> + (mapconcat
> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
> + properties "|") "|") "") ;properties columns, maybe
> (if indent (org-clocktable-indent-string level) "") ; indentation
> hlc headline hlc "|" ; headline
> (make-string (min (1- ntcol) (or (- level 1))) ?|)
> --
> 1.7.1
> #+end_src
>
> #+begin_src diff
> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
> From: Niels Giesen <niels.giesen@gmail.com>
> Date: Sat, 26 Mar 2011 14:48:21 +0100
> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
>
> When non-nil, properties are computed with inheritance.
> ---
> lisp/org-clock.el | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index a330db0..1eecb68 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (link (plist-get params :link))
> (tags (plist-get params :tags))
> (properties (plist-get params :properties))
> + (inherit-property-p (plist-get params :inherit-props))
> (matcher (if tags (cdr (org-make-tags-matcher tags))))
> cc range-text st p time level hdl props tsp tbl)
>
> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (remove nil
> (mapcar
> (lambda (p)
> - (when (org-entry-get (point) p)
> - (cons p (org-entry-get (point) p))))
> + (when (org-entry-get (point) p inherit-property-p)
> + (cons p (org-entry-get (point) p inherit-property-p))))
> properties))))
> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
> (setq tbl (nreverse tbl))
> --
> 1.7.1
> #+end_src
>
> niels
> --
> http://pft.github.com
>
- Carsten
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-02 9:33 ` Carsten Dominik
@ 2011-05-13 8:00 ` Niels Giesen
2011-05-13 8:03 ` Carsten Dominik
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Niels Giesen @ 2011-05-13 8:00 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Bernt Hansen, emacs-orgmode list
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
Carsten Dominik <carsten.dominik@gmail.com> writes:
> Dear Niels,
>
> I am confused by the three patch pieces applied to the same file.
Hi Carsten. Sorry for the confusion; I thought atomic commits were the
proper thing to do, but apparently they are not.
> Can you please resubmit, with a single patch, and a proper
> changelog-like entry?
I hope my current attachment is in the appropriate form.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Add :properties param to clocktables --]
[-- Type: text/x-diff, Size: 5333 bytes --]
From 9065d22f5e41d73a47c72e6ee3f70bd974bee9ff Mon Sep 17 00:00:00 2001
From: niels giesen <niels.giesen@gmail.com>
Date: Fri, 13 May 2011 09:43:15 +0200
Subject: [PATCH] org-clock: Implement columns of arbitrary properties for clocktables.
* org-mode/lisp/org-clock.el (org-clocktable-write-default): List
properties in their own columns.
(org-clock-get-table-data): Return alist of properties specified in
a clocktable's `BEGIN' line under :properties, inherited when
:inherit-props is non-nil.
Each property specified in :properties parameter of a clocktable's
`BEGIN' line will get a column in the clocktable, at the left side of
that table. When :inherit-props is specified, such properties will be
inherited.
---
lisp/org-clock.el | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index efeb72f..127f041 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1,6 +1,6 @@
;;; org-clock.el --- The time clocking code for Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
@@ -2059,6 +2059,7 @@ from the dynamic block defintion."
(emph (plist-get params :emphasize))
(level-p (plist-get params :level))
(timestamp (plist-get params :timestamp))
+ (properties (plist-get params :properties))
(ntcol (max 1 (or (plist-get params :tcolumns) 100)))
(rm-file-column (plist-get params :one-file-with-archives))
(indent (plist-get params :indent))
@@ -2122,6 +2123,7 @@ from the dynamic block defintion."
(if multifile "|" "") ; file column, maybe
(if level-p "|" "") ; level column, maybe
(if timestamp "|" "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(format "<%d>| |\n" narrow))) ; headline and time columns
;; Insert the table header line
@@ -2130,6 +2132,7 @@ from the dynamic block defintion."
(if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
(if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
(if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
+ (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
(concat (nth 4 lwords) "|"
(nth 5 lwords) "|\n")) ; headline and time columns
@@ -2141,6 +2144,7 @@ from the dynamic block defintion."
; file column, maybe
(if level-p "|" "") ; level column, maybe
(if timestamp "|" "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(concat "*" (nth 7 lwords) "*| ") ; instead of a headline
"*"
(org-minutes-to-hh:mm-string (or total-time 0)) ; the time
@@ -2164,6 +2168,7 @@ from the dynamic block defintion."
(file-name-nondirectory (car tbl))
(if level-p "| " "") ; level column, maybe
(if timestamp "| " "") ; timestamp column, maybe
+ (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
(org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
;; Get the list of node entries and iterate over it
@@ -2188,6 +2193,11 @@ from the dynamic block defintion."
(if multifile "|" "") ; free space for file name column?
(if level-p (format "%d|" (car entry)) "") ; level, maybe
(if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
+ (if properties
+ (concat
+ (mapconcat
+ (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
+ properties "|") "|") "") ;properties columns, maybe
(if indent (org-clocktable-indent-string level) "") ; indentation
hlc headline hlc "|" ; headline
(make-string (min (1- ntcol) (or (- level 1))) ?|)
@@ -2342,6 +2352,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(block (plist-get params :block))
(link (plist-get params :link))
(tags (plist-get params :tags))
+ (properties (plist-get params :properties))
+ (inherit-property-p (plist-get params :inherit-props))
(matcher (if tags (cdr (org-make-tags-matcher tags))))
cc range-text st p time level hdl props tsp tbl)
@@ -2395,8 +2407,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
(or (cdr (assoc "SCHEDULED" props))
(cdr (assoc "DEADLINE" props))
(cdr (assoc "TIMESTAMP" props))
- (cdr (assoc "TIMESTAMP_IA" props)))))
- (when (> time 0) (push (list level hdl tsp time) tbl))))))
+ (cdr (assoc "TIMESTAMP_IA" props))))
+ props (when properties
+ (remove nil
+ (mapcar
+ (lambda (p)
+ (when (org-entry-get (point) p inherit-property-p)
+ (cons p (org-entry-get (point) p inherit-property-p))))
+ properties))))
+ (when (> time 0) (push (list level hdl tsp time props) tbl))))))
(setq tbl (nreverse tbl))
(list file org-clock-file-total-minutes tbl))))
--
1.6.0.4
[-- Attachment #3: Type: text/plain, Size: 8368 bytes --]
> Thanks.
>
> - Carsten
>
> On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
>
>>
>> Here are a few patches to add property columns in clocktables. These
>> allow me e.g. to freely set different cost centers which is wanted @
>> my work, and also possibly small descriptions. It is generically set
>> up so I reckon other people may find use in this too.
>>
>> The patches together add two parameters to the dynamic block line:
>>
>> : :properties ("prop-this" "prop-other") :inherit-props t
>>
>> The property columns will be added at the left side of the existing
>> columns; I did experiment with adding them to the right, but because
>> of the variable number of levels (being defined both by :maxlevel and
>> the actual number of found levels), that did not work out well.
>>
>> I used the parameter =:inherit-props= to set inheritance for
>> properties, as I have learned in the past that
>> =org-use-property-inheritance= should be used very sparingly.
>>
>> #+begin_src diff
>> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
>> From: Niels Giesen <niels.giesen@gmail.com>
>> Date: Sat, 26 Mar 2011 10:19:08 +0100
>> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
>>
>> This param should be a list of strings referring to properties. Those
>> properties will be returned in an alist when found in an entry.
>> ---
>> lisp/org-clock.el | 14 +++++++++++---
>> 1 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>> index c567a26..df096d1 100644
>> --- a/lisp/org-clock.el
>> +++ b/lisp/org-clock.el
>> @@ -1,6 +1,6 @@
>> ;;; org-clock.el --- The time clocking code for Org-mode
>>
>> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
>> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>> ;; Free Software Foundation, Inc.
>>
>> ;; Author: Carsten Dominik <carsten at orgmode dot org>
>> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>> (block (plist-get params :block))
>> (link (plist-get params :link))
>> (tags (plist-get params :tags))
>> + (properties (plist-get params :properties))
>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>> cc range-text st p time level hdl props tsp tbl)
>>
>> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>> (or (cdr (assoc "SCHEDULED" props))
>> (cdr (assoc "DEADLINE" props))
>> (cdr (assoc "TIMESTAMP" props))
>> - (cdr (assoc "TIMESTAMP_IA" props)))))
>> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
>> + (cdr (assoc "TIMESTAMP_IA" props))))
>> + props (when properties
>> + (remove nil
>> + (mapcar
>> + (lambda (p)
>> + (when (org-entry-get (point) p)
>> + (cons p (org-entry-get (point) p))))
>> + properties))))
>> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>> (setq tbl (nreverse tbl))
>> (list file org-clock-file-total-minutes tbl))))
>>
>> --
>> 1.7.1
>> #+end_src
>>
>> #+begin_src diff
>> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
>> From: Niels Giesen <niels.giesen@gmail.com>
>> Date: Sat, 26 Mar 2011 11:05:33 +0100
>> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
>>
>> Each property specified in properties will get a column in the clocktable.
>> ---
>> lisp/org-clock.el | 10 ++++++++++
>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>> index df096d1..a330db0 100644
>> --- a/lisp/org-clock.el
>> +++ b/lisp/org-clock.el
>> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
>> (emph (plist-get params :emphasize))
>> (level-p (plist-get params :level))
>> (timestamp (plist-get params :timestamp))
>> + (properties (plist-get params :properties))
>> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
>> (rm-file-column (plist-get params :one-file-with-archives))
>> (indent (plist-get params :indent))
>> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
>> (if multifile "|" "") ; file column, maybe
>> (if level-p "|" "") ; level column, maybe
>> (if timestamp "|" "") ; timestamp column, maybe
>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>> (format "<%d>| |\n" narrow))) ; headline and time columns
>>
>> ;; Insert the table header line
>> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
>> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
>> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
>> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
>> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
>> (concat (nth 4 lwords) "|"
>> (nth 5 lwords) "|\n")) ; headline and time columns
>>
>> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
>> ; file column, maybe
>> (if level-p "|" "") ; level column, maybe
>> (if timestamp "|" "") ; timestamp column, maybe
>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
>> "*"
>> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
>> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
>> (file-name-nondirectory (car tbl))
>> (if level-p "| " "") ; level column, maybe
>> (if timestamp "| " "") ; timestamp column, maybe
>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>>
>> ;; Get the list of node entries and iterate over it
>> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
>> (if multifile "|" "") ; free space for file name column?
>> (if level-p (format "%d|" (car entry)) "") ; level, maybe
>> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
>> + (if properties
>> + (concat
>> + (mapconcat
>> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
>> + properties "|") "|") "") ;properties columns, maybe
>> (if indent (org-clocktable-indent-string level) "") ; indentation
>> hlc headline hlc "|" ; headline
>> (make-string (min (1- ntcol) (or (- level 1))) ?|)
>> --
>> 1.7.1
>> #+end_src
>>
>> #+begin_src diff
>> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
>> From: Niels Giesen <niels.giesen@gmail.com>
>> Date: Sat, 26 Mar 2011 14:48:21 +0100
>> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
>>
>> When non-nil, properties are computed with inheritance.
>> ---
>> lisp/org-clock.el | 5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>> index a330db0..1eecb68 100644
>> --- a/lisp/org-clock.el
>> +++ b/lisp/org-clock.el
>> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>> (link (plist-get params :link))
>> (tags (plist-get params :tags))
>> (properties (plist-get params :properties))
>> + (inherit-property-p (plist-get params :inherit-props))
>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>> cc range-text st p time level hdl props tsp tbl)
>>
>> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>> (remove nil
>> (mapcar
>> (lambda (p)
>> - (when (org-entry-get (point) p)
>> - (cons p (org-entry-get (point) p))))
>> + (when (org-entry-get (point) p inherit-property-p)
>> + (cons p (org-entry-get (point) p inherit-property-p))))
>> properties))))
>> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>> (setq tbl (nreverse tbl))
>> --
>> 1.7.1
>> #+end_src
>>
>> niels
>> --
>> http://pft.github.com
>>
>
> - Carsten
>
>
>
--
http://pft.github.com/
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-13 8:00 ` Niels Giesen
@ 2011-05-13 8:03 ` Carsten Dominik
2011-05-13 12:19 ` [Accepted] " Carsten Dominik
2011-05-13 12:20 ` lisp/org-clock.el: Add param :properties to list properties in clocktable Carsten Dominik
2 siblings, 0 replies; 14+ messages in thread
From: Carsten Dominik @ 2011-05-13 8:03 UTC (permalink / raw)
To: Niels Giesen; +Cc: Bernt Hansen, emacs-orgmode list
On May 13, 2011, at 10:00 AM, Niels Giesen wrote:
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> Dear Niels,
>>
>> I am confused by the three patch pieces applied to the same file.
>
> Hi Carsten. Sorry for the confusion; I thought atomic commits were the
> proper thing to do, but apparently they are not.
Hi Niels,
small commits are good when you use git format-patch to send them, or if
you publish a git branch.
I'll take a look at this soon.
- Carsten
>
>> Can you please resubmit, with a single patch, and a proper
>> changelog-like entry?
>
> I hope my current attachment is in the appropriate form.
>
> <0001-org-clock-Implement-columns-of-arbitrary-properties.patch>
>> Thanks.
>>
>> - Carsten
>>
>> On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
>>
>>>
>>> Here are a few patches to add property columns in clocktables. These
>>> allow me e.g. to freely set different cost centers which is wanted @
>>> my work, and also possibly small descriptions. It is generically set
>>> up so I reckon other people may find use in this too.
>>>
>>> The patches together add two parameters to the dynamic block line:
>>>
>>> : :properties ("prop-this" "prop-other") :inherit-props t
>>>
>>> The property columns will be added at the left side of the existing
>>> columns; I did experiment with adding them to the right, but because
>>> of the variable number of levels (being defined both by :maxlevel and
>>> the actual number of found levels), that did not work out well.
>>>
>>> I used the parameter =:inherit-props= to set inheritance for
>>> properties, as I have learned in the past that
>>> =org-use-property-inheritance= should be used very sparingly.
>>>
>>> #+begin_src diff
>>> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 10:19:08 +0100
>>> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
>>>
>>> This param should be a list of strings referring to properties. Those
>>> properties will be returned in an alist when found in an entry.
>>> ---
>>> lisp/org-clock.el | 14 +++++++++++---
>>> 1 files changed, 11 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index c567a26..df096d1 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -1,6 +1,6 @@
>>> ;;; org-clock.el --- The time clocking code for Org-mode
>>>
>>> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
>>> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>>> ;; Free Software Foundation, Inc.
>>>
>>> ;; Author: Carsten Dominik <carsten at orgmode dot org>
>>> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (block (plist-get params :block))
>>> (link (plist-get params :link))
>>> (tags (plist-get params :tags))
>>> + (properties (plist-get params :properties))
>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>> cc range-text st p time level hdl props tsp tbl)
>>>
>>> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (or (cdr (assoc "SCHEDULED" props))
>>> (cdr (assoc "DEADLINE" props))
>>> (cdr (assoc "TIMESTAMP" props))
>>> - (cdr (assoc "TIMESTAMP_IA" props)))))
>>> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
>>> + (cdr (assoc "TIMESTAMP_IA" props))))
>>> + props (when properties
>>> + (remove nil
>>> + (mapcar
>>> + (lambda (p)
>>> + (when (org-entry-get (point) p)
>>> + (cons p (org-entry-get (point) p))))
>>> + properties))))
>>> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>> (setq tbl (nreverse tbl))
>>> (list file org-clock-file-total-minutes tbl))))
>>>
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> #+begin_src diff
>>> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 11:05:33 +0100
>>> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
>>>
>>> Each property specified in properties will get a column in the clocktable.
>>> ---
>>> lisp/org-clock.el | 10 ++++++++++
>>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index df096d1..a330db0 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
>>> (emph (plist-get params :emphasize))
>>> (level-p (plist-get params :level))
>>> (timestamp (plist-get params :timestamp))
>>> + (properties (plist-get params :properties))
>>> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
>>> (rm-file-column (plist-get params :one-file-with-archives))
>>> (indent (plist-get params :indent))
>>> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
>>> (if multifile "|" "") ; file column, maybe
>>> (if level-p "|" "") ; level column, maybe
>>> (if timestamp "|" "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (format "<%d>| |\n" narrow))) ; headline and time columns
>>>
>>> ;; Insert the table header line
>>> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
>>> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
>>> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
>>> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
>>> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
>>> (concat (nth 4 lwords) "|"
>>> (nth 5 lwords) "|\n")) ; headline and time columns
>>>
>>> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
>>> ; file column, maybe
>>> (if level-p "|" "") ; level column, maybe
>>> (if timestamp "|" "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
>>> "*"
>>> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
>>> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
>>> (file-name-nondirectory (car tbl))
>>> (if level-p "| " "") ; level column, maybe
>>> (if timestamp "| " "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>>>
>>> ;; Get the list of node entries and iterate over it
>>> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
>>> (if multifile "|" "") ; free space for file name column?
>>> (if level-p (format "%d|" (car entry)) "") ; level, maybe
>>> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
>>> + (if properties
>>> + (concat
>>> + (mapconcat
>>> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
>>> + properties "|") "|") "") ;properties columns, maybe
>>> (if indent (org-clocktable-indent-string level) "") ; indentation
>>> hlc headline hlc "|" ; headline
>>> (make-string (min (1- ntcol) (or (- level 1))) ?|)
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> #+begin_src diff
>>> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 14:48:21 +0100
>>> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
>>>
>>> When non-nil, properties are computed with inheritance.
>>> ---
>>> lisp/org-clock.el | 5 +++--
>>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index a330db0..1eecb68 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (link (plist-get params :link))
>>> (tags (plist-get params :tags))
>>> (properties (plist-get params :properties))
>>> + (inherit-property-p (plist-get params :inherit-props))
>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>> cc range-text st p time level hdl props tsp tbl)
>>>
>>> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (remove nil
>>> (mapcar
>>> (lambda (p)
>>> - (when (org-entry-get (point) p)
>>> - (cons p (org-entry-get (point) p))))
>>> + (when (org-entry-get (point) p inherit-property-p)
>>> + (cons p (org-entry-get (point) p inherit-property-p))))
>>> properties))))
>>> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>> (setq tbl (nreverse tbl))
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> niels
>>> --
>>> http://pft.github.com
>>>
>>
>> - Carsten
>>
>>
>>
>
> --
> http://pft.github.com/
- Carsten
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Accepted] lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-13 8:00 ` Niels Giesen
2011-05-13 8:03 ` Carsten Dominik
@ 2011-05-13 12:19 ` Carsten Dominik
2011-06-08 19:41 ` [PATCH] Fix reported file time for clock reports Bernt Hansen
2011-05-13 12:20 ` lisp/org-clock.el: Add param :properties to list properties in clocktable Carsten Dominik
2 siblings, 1 reply; 14+ messages in thread
From: Carsten Dominik @ 2011-05-13 12:19 UTC (permalink / raw)
To: emacs-orgmode
Patch 805 (http://patchwork.newartisans.com/patch/805/) is now "Accepted".
Maintainer comment: I added documentation in org.texi
This relates to the following submission:
http://mid.gmane.org/%3C8762pfni74.fsf%40gmail.com%3E
Here is the original message containing the patch:
> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] lisp/org-clock.el: Add param :properties to list properties in
> clocktable
> Date: Fri, 13 May 2011 13:00:31 -0000
> From: niels giesen <niels.giesen@gmail.com>
> X-Patchwork-Id: 805
> Message-Id: <8762pfni74.fsf@gmail.com>
> To: Carsten Dominik <carsten.dominik@gmail.com>
> Cc: Bernt Hansen <bernt@norang.ca>, emacs-orgmode list <emacs-orgmode@gnu.org>
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
> > Dear Niels,
> >
> > I am confused by the three patch pieces applied to the same file.
>
> Hi Carsten. Sorry for the confusion; I thought atomic commits were the
> proper thing to do, but apparently they are not.
>
> > Can you please resubmit, with a single patch, and a proper
> > changelog-like entry?
>
> I hope my current attachment is in the appropriate form.
> > Thanks.
> >
> > - Carsten
> >
> > On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
> >
> >>
> >> Here are a few patches to add property columns in clocktables. These
> >> allow me e.g. to freely set different cost centers which is wanted @
> >> my work, and also possibly small descriptions. It is generically set
> >> up so I reckon other people may find use in this too.
> >>
> >> The patches together add two parameters to the dynamic block line:
> >>
> >> : :properties ("prop-this" "prop-other") :inherit-props t
> >>
> >> The property columns will be added at the left side of the existing
> >> columns; I did experiment with adding them to the right, but because
> >> of the variable number of levels (being defined both by :maxlevel and
> >> the actual number of found levels), that did not work out well.
> >>
> >> I used the parameter =:inherit-props= to set inheritance for
> >> properties, as I have learned in the past that
> >> =org-use-property-inheritance= should be used very sparingly.
> >>
> >> #+begin_src diff
> >> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
> >> From: Niels Giesen <niels.giesen@gmail.com>
> >> Date: Sat, 26 Mar 2011 10:19:08 +0100
> >> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
> >>
> >> This param should be a list of strings referring to properties. Those
> >> properties will be returned in an alist when found in an entry.
> >> ---
> >> lisp/org-clock.el | 14 +++++++++++---
> >> 1 files changed, 11 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> >> index c567a26..df096d1 100644
> >> --- a/lisp/org-clock.el
> >> +++ b/lisp/org-clock.el
> >> @@ -1,6 +1,6 @@
> >> ;;; org-clock.el --- The time clocking code for Org-mode
> >>
> >> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
> >> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
> >> ;; Free Software Foundation, Inc.
> >>
> >> ;; Author: Carsten Dominik <carsten at orgmode dot org>
> >> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> >> (block (plist-get params :block))
> >> (link (plist-get params :link))
> >> (tags (plist-get params :tags))
> >> + (properties (plist-get params :properties))
> >> (matcher (if tags (cdr (org-make-tags-matcher tags))))
> >> cc range-text st p time level hdl props tsp tbl)
> >>
> >> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> >> (or (cdr (assoc "SCHEDULED" props))
> >> (cdr (assoc "DEADLINE" props))
> >> (cdr (assoc "TIMESTAMP" props))
> >> - (cdr (assoc "TIMESTAMP_IA" props)))))
> >> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
> >> + (cdr (assoc "TIMESTAMP_IA" props))))
> >> + props (when properties
> >> + (remove nil
> >> + (mapcar
> >> + (lambda (p)
> >> + (when (org-entry-get (point) p)
> >> + (cons p (org-entry-get (point) p))))
> >> + properties))))
> >> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
> >> (setq tbl (nreverse tbl))
> >> (list file org-clock-file-total-minutes tbl))))
> >>
> >> --
> >> 1.7.1
> >> #+end_src
> >>
> >> #+begin_src diff
> >> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
> >> From: Niels Giesen <niels.giesen@gmail.com>
> >> Date: Sat, 26 Mar 2011 11:05:33 +0100
> >> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
> >>
> >> Each property specified in properties will get a column in the clocktable.
> >> ---
> >> lisp/org-clock.el | 10 ++++++++++
> >> 1 files changed, 10 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> >> index df096d1..a330db0 100644
> >> --- a/lisp/org-clock.el
> >> +++ b/lisp/org-clock.el
> >> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
> >> (emph (plist-get params :emphasize))
> >> (level-p (plist-get params :level))
> >> (timestamp (plist-get params :timestamp))
> >> + (properties (plist-get params :properties))
> >> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
> >> (rm-file-column (plist-get params :one-file-with-archives))
> >> (indent (plist-get params :indent))
> >> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
> >> (if multifile "|" "") ; file column, maybe
> >> (if level-p "|" "") ; level column, maybe
> >> (if timestamp "|" "") ; timestamp column, maybe
> >> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> >> (format "<%d>| |\n" narrow))) ; headline and time columns
> >>
> >> ;; Insert the table header line
> >> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
> >> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
> >> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
> >> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
> >> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
> >> (concat (nth 4 lwords) "|"
> >> (nth 5 lwords) "|\n")) ; headline and time columns
> >>
> >> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
> >> ; file column, maybe
> >> (if level-p "|" "") ; level column, maybe
> >> (if timestamp "|" "") ; timestamp column, maybe
> >> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> >> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
> >> "*"
> >> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
> >> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
> >> (file-name-nondirectory (car tbl))
> >> (if level-p "| " "") ; level column, maybe
> >> (if timestamp "| " "") ; timestamp column, maybe
> >> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> >> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
> >>
> >> ;; Get the list of node entries and iterate over it
> >> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
> >> (if multifile "|" "") ; free space for file name column?
> >> (if level-p (format "%d|" (car entry)) "") ; level, maybe
> >> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
> >> + (if properties
> >> + (concat
> >> + (mapconcat
> >> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
> >> + properties "|") "|") "") ;properties columns, maybe
> >> (if indent (org-clocktable-indent-string level) "") ; indentation
> >> hlc headline hlc "|" ; headline
> >> (make-string (min (1- ntcol) (or (- level 1))) ?|)
> >> --
> >> 1.7.1
> >> #+end_src
> >>
> >> #+begin_src diff
> >> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
> >> From: Niels Giesen <niels.giesen@gmail.com>
> >> Date: Sat, 26 Mar 2011 14:48:21 +0100
> >> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
> >>
> >> When non-nil, properties are computed with inheritance.
> >> ---
> >> lisp/org-clock.el | 5 +++--
> >> 1 files changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> >> index a330db0..1eecb68 100644
> >> --- a/lisp/org-clock.el
> >> +++ b/lisp/org-clock.el
> >> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> >> (link (plist-get params :link))
> >> (tags (plist-get params :tags))
> >> (properties (plist-get params :properties))
> >> + (inherit-property-p (plist-get params :inherit-props))
> >> (matcher (if tags (cdr (org-make-tags-matcher tags))))
> >> cc range-text st p time level hdl props tsp tbl)
> >>
> >> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> >> (remove nil
> >> (mapcar
> >> (lambda (p)
> >> - (when (org-entry-get (point) p)
> >> - (cons p (org-entry-get (point) p))))
> >> + (when (org-entry-get (point) p inherit-property-p)
> >> + (cons p (org-entry-get (point) p inherit-property-p))))
> >> properties))))
> >> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
> >> (setq tbl (nreverse tbl))
> >> --
> >> 1.7.1
> >> #+end_src
> >>
> >> niels
> >> --
> >> http://pft.github.com
> >>
> >
> > - Carsten
> >
> >
> >
>
>
> >From 9065d22f5e41d73a47c72e6ee3f70bd974bee9ff Mon Sep 17 00:00:00 2001
> From: niels giesen <niels.giesen@gmail.com>
> Date: Fri, 13 May 2011 09:43:15 +0200
> Subject: [PATCH] org-clock: Implement columns of arbitrary properties for clocktables.
>
> * org-mode/lisp/org-clock.el (org-clocktable-write-default): List
> properties in their own columns.
> (org-clock-get-table-data): Return alist of properties specified in
> a clocktable's `BEGIN' line under :properties, inherited when
> :inherit-props is non-nil.
>
> Each property specified in :properties parameter of a clocktable's
> `BEGIN' line will get a column in the clocktable, at the left side of
> that table. When :inherit-props is specified, such properties will be
> inherited.
> ---
> lisp/org-clock.el | 25 ++++++++++++++++++++++---
> 1 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index efeb72f..127f041 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -1,6 +1,6 @@
> ;;; org-clock.el --- The time clocking code for Org-mode
>
> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
> ;; Free Software Foundation, Inc.
>
> ;; Author: Carsten Dominik <carsten at orgmode dot org>
> @@ -2059,6 +2059,7 @@ from the dynamic block defintion."
> (emph (plist-get params :emphasize))
> (level-p (plist-get params :level))
> (timestamp (plist-get params :timestamp))
> + (properties (plist-get params :properties))
> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
> (rm-file-column (plist-get params :one-file-with-archives))
> (indent (plist-get params :indent))
> @@ -2122,6 +2123,7 @@ from the dynamic block defintion."
> (if multifile "|" "") ; file column, maybe
> (if level-p "|" "") ; level column, maybe
> (if timestamp "|" "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (format "<%d>| |\n" narrow))) ; headline and time columns
>
> ;; Insert the table header line
> @@ -2130,6 +2132,7 @@ from the dynamic block defintion."
> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
> (concat (nth 4 lwords) "|"
> (nth 5 lwords) "|\n")) ; headline and time columns
>
> @@ -2141,6 +2144,7 @@ from the dynamic block defintion."
> ; file column, maybe
> (if level-p "|" "") ; level column, maybe
> (if timestamp "|" "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
> "*"
> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
> @@ -2164,6 +2168,7 @@ from the dynamic block defintion."
> (file-name-nondirectory (car tbl))
> (if level-p "| " "") ; level column, maybe
> (if timestamp "| " "") ; timestamp column, maybe
> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>
> ;; Get the list of node entries and iterate over it
> @@ -2188,6 +2193,11 @@ from the dynamic block defintion."
> (if multifile "|" "") ; free space for file name column?
> (if level-p (format "%d|" (car entry)) "") ; level, maybe
> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
> + (if properties
> + (concat
> + (mapconcat
> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
> + properties "|") "|") "") ;properties columns, maybe
> (if indent (org-clocktable-indent-string level) "") ; indentation
> hlc headline hlc "|" ; headline
> (make-string (min (1- ntcol) (or (- level 1))) ?|)
> @@ -2342,6 +2352,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (block (plist-get params :block))
> (link (plist-get params :link))
> (tags (plist-get params :tags))
> + (properties (plist-get params :properties))
> + (inherit-property-p (plist-get params :inherit-props))
> (matcher (if tags (cdr (org-make-tags-matcher tags))))
> cc range-text st p time level hdl props tsp tbl)
>
> @@ -2395,8 +2407,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
> (or (cdr (assoc "SCHEDULED" props))
> (cdr (assoc "DEADLINE" props))
> (cdr (assoc "TIMESTAMP" props))
> - (cdr (assoc "TIMESTAMP_IA" props)))))
> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
> + (cdr (assoc "TIMESTAMP_IA" props))))
> + props (when properties
> + (remove nil
> + (mapcar
> + (lambda (p)
> + (when (org-entry-get (point) p inherit-property-p)
> + (cons p (org-entry-get (point) p inherit-property-p))))
> + properties))))
> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
> (setq tbl (nreverse tbl))
> (list file org-clock-file-total-minutes tbl))))
>
> --
> 1.6.0.4
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-13 8:00 ` Niels Giesen
2011-05-13 8:03 ` Carsten Dominik
2011-05-13 12:19 ` [Accepted] " Carsten Dominik
@ 2011-05-13 12:20 ` Carsten Dominik
2011-05-13 12:35 ` Giovanni Ridolfi
2011-05-18 7:08 ` Niels Giesen
2 siblings, 2 replies; 14+ messages in thread
From: Carsten Dominik @ 2011-05-13 12:20 UTC (permalink / raw)
To: Niels Giesen; +Cc: Bernt Hansen, emacs-orgmode list
Hi Niels, I have merged your patch thanks.
A tutorial on Worg for your use case would be really helpful.
- Carsten
On May 13, 2011, at 10:00 AM, Niels Giesen wrote:
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> Dear Niels,
>>
>> I am confused by the three patch pieces applied to the same file.
>
> Hi Carsten. Sorry for the confusion; I thought atomic commits were the
> proper thing to do, but apparently they are not.
>
>> Can you please resubmit, with a single patch, and a proper
>> changelog-like entry?
>
> I hope my current attachment is in the appropriate form.
>
> <0001-org-clock-Implement-columns-of-arbitrary-properties.patch>
>> Thanks.
>>
>> - Carsten
>>
>> On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
>>
>>>
>>> Here are a few patches to add property columns in clocktables. These
>>> allow me e.g. to freely set different cost centers which is wanted @
>>> my work, and also possibly small descriptions. It is generically set
>>> up so I reckon other people may find use in this too.
>>>
>>> The patches together add two parameters to the dynamic block line:
>>>
>>> : :properties ("prop-this" "prop-other") :inherit-props t
>>>
>>> The property columns will be added at the left side of the existing
>>> columns; I did experiment with adding them to the right, but because
>>> of the variable number of levels (being defined both by :maxlevel and
>>> the actual number of found levels), that did not work out well.
>>>
>>> I used the parameter =:inherit-props= to set inheritance for
>>> properties, as I have learned in the past that
>>> =org-use-property-inheritance= should be used very sparingly.
>>>
>>> #+begin_src diff
>>> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 10:19:08 +0100
>>> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
>>>
>>> This param should be a list of strings referring to properties. Those
>>> properties will be returned in an alist when found in an entry.
>>> ---
>>> lisp/org-clock.el | 14 +++++++++++---
>>> 1 files changed, 11 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index c567a26..df096d1 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -1,6 +1,6 @@
>>> ;;; org-clock.el --- The time clocking code for Org-mode
>>>
>>> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
>>> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>>> ;; Free Software Foundation, Inc.
>>>
>>> ;; Author: Carsten Dominik <carsten at orgmode dot org>
>>> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (block (plist-get params :block))
>>> (link (plist-get params :link))
>>> (tags (plist-get params :tags))
>>> + (properties (plist-get params :properties))
>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>> cc range-text st p time level hdl props tsp tbl)
>>>
>>> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (or (cdr (assoc "SCHEDULED" props))
>>> (cdr (assoc "DEADLINE" props))
>>> (cdr (assoc "TIMESTAMP" props))
>>> - (cdr (assoc "TIMESTAMP_IA" props)))))
>>> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
>>> + (cdr (assoc "TIMESTAMP_IA" props))))
>>> + props (when properties
>>> + (remove nil
>>> + (mapcar
>>> + (lambda (p)
>>> + (when (org-entry-get (point) p)
>>> + (cons p (org-entry-get (point) p))))
>>> + properties))))
>>> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>> (setq tbl (nreverse tbl))
>>> (list file org-clock-file-total-minutes tbl))))
>>>
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> #+begin_src diff
>>> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 11:05:33 +0100
>>> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
>>>
>>> Each property specified in properties will get a column in the clocktable.
>>> ---
>>> lisp/org-clock.el | 10 ++++++++++
>>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index df096d1..a330db0 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
>>> (emph (plist-get params :emphasize))
>>> (level-p (plist-get params :level))
>>> (timestamp (plist-get params :timestamp))
>>> + (properties (plist-get params :properties))
>>> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
>>> (rm-file-column (plist-get params :one-file-with-archives))
>>> (indent (plist-get params :indent))
>>> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
>>> (if multifile "|" "") ; file column, maybe
>>> (if level-p "|" "") ; level column, maybe
>>> (if timestamp "|" "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (format "<%d>| |\n" narrow))) ; headline and time columns
>>>
>>> ;; Insert the table header line
>>> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
>>> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
>>> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
>>> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
>>> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
>>> (concat (nth 4 lwords) "|"
>>> (nth 5 lwords) "|\n")) ; headline and time columns
>>>
>>> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
>>> ; file column, maybe
>>> (if level-p "|" "") ; level column, maybe
>>> (if timestamp "|" "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
>>> "*"
>>> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
>>> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
>>> (file-name-nondirectory (car tbl))
>>> (if level-p "| " "") ; level column, maybe
>>> (if timestamp "| " "") ; timestamp column, maybe
>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>>>
>>> ;; Get the list of node entries and iterate over it
>>> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
>>> (if multifile "|" "") ; free space for file name column?
>>> (if level-p (format "%d|" (car entry)) "") ; level, maybe
>>> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
>>> + (if properties
>>> + (concat
>>> + (mapconcat
>>> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
>>> + properties "|") "|") "") ;properties columns, maybe
>>> (if indent (org-clocktable-indent-string level) "") ; indentation
>>> hlc headline hlc "|" ; headline
>>> (make-string (min (1- ntcol) (or (- level 1))) ?|)
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> #+begin_src diff
>>> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
>>> From: Niels Giesen <niels.giesen@gmail.com>
>>> Date: Sat, 26 Mar 2011 14:48:21 +0100
>>> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
>>>
>>> When non-nil, properties are computed with inheritance.
>>> ---
>>> lisp/org-clock.el | 5 +++--
>>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>> index a330db0..1eecb68 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (link (plist-get params :link))
>>> (tags (plist-get params :tags))
>>> (properties (plist-get params :properties))
>>> + (inherit-property-p (plist-get params :inherit-props))
>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>> cc range-text st p time level hdl props tsp tbl)
>>>
>>> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>> (remove nil
>>> (mapcar
>>> (lambda (p)
>>> - (when (org-entry-get (point) p)
>>> - (cons p (org-entry-get (point) p))))
>>> + (when (org-entry-get (point) p inherit-property-p)
>>> + (cons p (org-entry-get (point) p inherit-property-p))))
>>> properties))))
>>> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>> (setq tbl (nreverse tbl))
>>> --
>>> 1.7.1
>>> #+end_src
>>>
>>> niels
>>> --
>>> http://pft.github.com
>>>
>>
>> - Carsten
>>
>>
>>
>
> --
> http://pft.github.com/
- Carsten
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-13 12:20 ` lisp/org-clock.el: Add param :properties to list properties in clocktable Carsten Dominik
@ 2011-05-13 12:35 ` Giovanni Ridolfi
2011-05-18 7:08 ` Niels Giesen
1 sibling, 0 replies; 14+ messages in thread
From: Giovanni Ridolfi @ 2011-05-13 12:35 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Bernt Hansen, emacs-orgmode list
Carsten Dominik <carsten.dominik@gmail.com> writes:
> Hi Niels, I have merged your patch thanks.
> A tutorial on Worg for your use case would be really helpful.
\o/ yeah yeah yeah! \o/
|_/ \|/
_/
/me performing: http://dilbert.com/strips/comic/1997-11-27/
Giovanni
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-13 12:20 ` lisp/org-clock.el: Add param :properties to list properties in clocktable Carsten Dominik
2011-05-13 12:35 ` Giovanni Ridolfi
@ 2011-05-18 7:08 ` Niels Giesen
2011-05-18 8:43 ` Giovanni Ridolfi
1 sibling, 1 reply; 14+ messages in thread
From: Niels Giesen @ 2011-05-18 7:08 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Bernt Hansen, emacs-orgmode list
Hi Carsten,
thanks for merging, but today, pulling origin master (from
git://orgmode.org/org-mode.git) to start work on such a tutorial &
checkout the new documentation, I did not see the patch applied.
Should be somewhere near 5 days ago on
http://orgmode.org/w/org-mode.git.
Am I missing something here?
Regards,
Niels.
On Fri, May 13, 2011 at 2:20 PM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
> Hi Niels, I have merged your patch thanks.
> A tutorial on Worg for your use case would be really helpful.
>
> - Carsten
>
> On May 13, 2011, at 10:00 AM, Niels Giesen wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>>> Dear Niels,
>>>
>>> I am confused by the three patch pieces applied to the same file.
>>
>> Hi Carsten. Sorry for the confusion; I thought atomic commits were the
>> proper thing to do, but apparently they are not.
>>
>>> Can you please resubmit, with a single patch, and a proper
>>> changelog-like entry?
>>
>> I hope my current attachment is in the appropriate form.
>>
>> <0001-org-clock-Implement-columns-of-arbitrary-properties.patch>
>>> Thanks.
>>>
>>> - Carsten
>>>
>>> On Mar 26, 2011, at 9:29 PM, Niels Giesen wrote:
>>>
>>>>
>>>> Here are a few patches to add property columns in clocktables. These
>>>> allow me e.g. to freely set different cost centers which is wanted @
>>>> my work, and also possibly small descriptions. It is generically set
>>>> up so I reckon other people may find use in this too.
>>>>
>>>> The patches together add two parameters to the dynamic block line:
>>>>
>>>> : :properties ("prop-this" "prop-other") :inherit-props t
>>>>
>>>> The property columns will be added at the left side of the existing
>>>> columns; I did experiment with adding them to the right, but because
>>>> of the variable number of levels (being defined both by :maxlevel and
>>>> the actual number of found levels), that did not work out well.
>>>>
>>>> I used the parameter =:inherit-props= to set inheritance for
>>>> properties, as I have learned in the past that
>>>> =org-use-property-inheritance= should be used very sparingly.
>>>>
>>>> #+begin_src diff
>>>> From 20346cf661e2b9ba0b4a66b705809e6100d9e8e0 Mon Sep 17 00:00:00 2001
>>>> From: Niels Giesen <niels.giesen@gmail.com>
>>>> Date: Sat, 26 Mar 2011 10:19:08 +0100
>>>> Subject: [PATCH 1/3] org-clock: Add properties param handling to `org-clock-get-table-data'
>>>>
>>>> This param should be a list of strings referring to properties. Those
>>>> properties will be returned in an alist when found in an entry.
>>>> ---
>>>> lisp/org-clock.el | 14 +++++++++++---
>>>> 1 files changed, 11 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>>> index c567a26..df096d1 100644
>>>> --- a/lisp/org-clock.el
>>>> +++ b/lisp/org-clock.el
>>>> @@ -1,6 +1,6 @@
>>>> ;;; org-clock.el --- The time clocking code for Org-mode
>>>>
>>>> -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
>>>> +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
>>>> ;; Free Software Foundation, Inc.
>>>>
>>>> ;; Author: Carsten Dominik <carsten at orgmode dot org>
>>>> @@ -2335,6 +2335,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>>> (block (plist-get params :block))
>>>> (link (plist-get params :link))
>>>> (tags (plist-get params :tags))
>>>> + (properties (plist-get params :properties))
>>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>>> cc range-text st p time level hdl props tsp tbl)
>>>>
>>>> @@ -2388,8 +2389,15 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>>> (or (cdr (assoc "SCHEDULED" props))
>>>> (cdr (assoc "DEADLINE" props))
>>>> (cdr (assoc "TIMESTAMP" props))
>>>> - (cdr (assoc "TIMESTAMP_IA" props)))))
>>>> - (when (> time 0) (push (list level hdl tsp time) tbl))))))
>>>> + (cdr (assoc "TIMESTAMP_IA" props))))
>>>> + props (when properties
>>>> + (remove nil
>>>> + (mapcar
>>>> + (lambda (p)
>>>> + (when (org-entry-get (point) p)
>>>> + (cons p (org-entry-get (point) p))))
>>>> + properties))))
>>>> + (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>>> (setq tbl (nreverse tbl))
>>>> (list file org-clock-file-total-minutes tbl))))
>>>>
>>>> --
>>>> 1.7.1
>>>> #+end_src
>>>>
>>>> #+begin_src diff
>>>> From a5da80e0b42256e1a1ea07e213bcae3685786589 Mon Sep 17 00:00:00 2001
>>>> From: Niels Giesen <niels.giesen@gmail.com>
>>>> Date: Sat, 26 Mar 2011 11:05:33 +0100
>>>> Subject: [PATCH 2/3] org-clock: Add properties param handling to `org-clocktable-write-default'
>>>>
>>>> Each property specified in properties will get a column in the clocktable.
>>>> ---
>>>> lisp/org-clock.el | 10 ++++++++++
>>>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>>> index df096d1..a330db0 100644
>>>> --- a/lisp/org-clock.el
>>>> +++ b/lisp/org-clock.el
>>>> @@ -2052,6 +2052,7 @@ from the dynamic block defintion."
>>>> (emph (plist-get params :emphasize))
>>>> (level-p (plist-get params :level))
>>>> (timestamp (plist-get params :timestamp))
>>>> + (properties (plist-get params :properties))
>>>> (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
>>>> (rm-file-column (plist-get params :one-file-with-archives))
>>>> (indent (plist-get params :indent))
>>>> @@ -2115,6 +2116,7 @@ from the dynamic block defintion."
>>>> (if multifile "|" "") ; file column, maybe
>>>> (if level-p "|" "") ; level column, maybe
>>>> (if timestamp "|" "") ; timestamp column, maybe
>>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>>> (format "<%d>| |\n" narrow))) ; headline and time columns
>>>>
>>>> ;; Insert the table header line
>>>> @@ -2123,6 +2125,7 @@ from the dynamic block defintion."
>>>> (if multifile (concat (nth 1 lwords) "|") "") ; file column, maybe
>>>> (if level-p (concat (nth 2 lwords) "|") "") ; level column, maybe
>>>> (if timestamp (concat (nth 3 lwords) "|") "") ; timestamp column, maybe
>>>> + (if properties (concat (mapconcat 'identity properties "|") "|") "") ;properties columns, maybe
>>>> (concat (nth 4 lwords) "|"
>>>> (nth 5 lwords) "|\n")) ; headline and time columns
>>>>
>>>> @@ -2134,6 +2137,7 @@ from the dynamic block defintion."
>>>> ; file column, maybe
>>>> (if level-p "|" "") ; level column, maybe
>>>> (if timestamp "|" "") ; timestamp column, maybe
>>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>>> (concat "*" (nth 7 lwords) "*| ") ; instead of a headline
>>>> "*"
>>>> (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
>>>> @@ -2157,6 +2161,7 @@ from the dynamic block defintion."
>>>> (file-name-nondirectory (car tbl))
>>>> (if level-p "| " "") ; level column, maybe
>>>> (if timestamp "| " "") ; timestamp column, maybe
>>>> + (if properties (make-string (length properties) ?|) "") ;properties columns, maybe
>>>> (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
>>>>
>>>> ;; Get the list of node entries and iterate over it
>>>> @@ -2181,6 +2186,11 @@ from the dynamic block defintion."
>>>> (if multifile "|" "") ; free space for file name column?
>>>> (if level-p (format "%d|" (car entry)) "") ; level, maybe
>>>> (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
>>>> + (if properties
>>>> + (concat
>>>> + (mapconcat
>>>> + (lambda (p) (or (cdr (assoc p (nth 4 entry))) ""))
>>>> + properties "|") "|") "") ;properties columns, maybe
>>>> (if indent (org-clocktable-indent-string level) "") ; indentation
>>>> hlc headline hlc "|" ; headline
>>>> (make-string (min (1- ntcol) (or (- level 1))) ?|)
>>>> --
>>>> 1.7.1
>>>> #+end_src
>>>>
>>>> #+begin_src diff
>>>> From e7b95ec4b61ada44d501e1212d3a3cb80e663911 Mon Sep 17 00:00:00 2001
>>>> From: Niels Giesen <niels.giesen@gmail.com>
>>>> Date: Sat, 26 Mar 2011 14:48:21 +0100
>>>> Subject: [PATCH 3/3] org-clock: Add param :inherit-props
>>>>
>>>> When non-nil, properties are computed with inheritance.
>>>> ---
>>>> lisp/org-clock.el | 5 +++--
>>>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
>>>> index a330db0..1eecb68 100644
>>>> --- a/lisp/org-clock.el
>>>> +++ b/lisp/org-clock.el
>>>> @@ -2346,6 +2346,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>>> (link (plist-get params :link))
>>>> (tags (plist-get params :tags))
>>>> (properties (plist-get params :properties))
>>>> + (inherit-property-p (plist-get params :inherit-props))
>>>> (matcher (if tags (cdr (org-make-tags-matcher tags))))
>>>> cc range-text st p time level hdl props tsp tbl)
>>>>
>>>> @@ -2404,8 +2405,8 @@ TIME: The sum of all time spend in this tree, in minutes. This time
>>>> (remove nil
>>>> (mapcar
>>>> (lambda (p)
>>>> - (when (org-entry-get (point) p)
>>>> - (cons p (org-entry-get (point) p))))
>>>> + (when (org-entry-get (point) p inherit-property-p)
>>>> + (cons p (org-entry-get (point) p inherit-property-p))))
>>>> properties))))
>>>> (when (> time 0) (push (list level hdl tsp time props) tbl))))))
>>>> (setq tbl (nreverse tbl))
>>>> --
>>>> 1.7.1
>>>> #+end_src
>>>>
>>>> niels
>>>> --
>>>> http://pft.github.com
>>>>
>>>
>>> - Carsten
>>>
>>>
>>>
>>
>> --
>> http://pft.github.com/
>
> - Carsten
>
>
>
>
--
http://pft.github.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: lisp/org-clock.el: Add param :properties to list properties in clocktable
2011-05-18 7:08 ` Niels Giesen
@ 2011-05-18 8:43 ` Giovanni Ridolfi
0 siblings, 0 replies; 14+ messages in thread
From: Giovanni Ridolfi @ 2011-05-18 8:43 UTC (permalink / raw)
To: Niels Giesen; +Cc: Bernt Hansen, emacs-orgmode list, Carsten Dominik
Niels Giesen <niels.giesen@gmail.com> writes:
Hi, Niels,
> I did not see the patch applied.
> Should be somewhere near 5 days ago on
> http://orgmode.org/w/org-mode.git.
>
> Am I missing something here?
No. You're right. I checked two times the log in the
git public hosting and your patch is not there.
I suspect Carsten applied it in his repo, but forgot to commit
to the "central" repo.
Let's wait :-)
Giovanni, eager to try the new feature :-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] Fix reported file time for clock reports
2011-05-13 12:19 ` [Accepted] " Carsten Dominik
@ 2011-06-08 19:41 ` Bernt Hansen
0 siblings, 0 replies; 14+ messages in thread
From: Bernt Hansen @ 2011-06-08 19:41 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bernt Hansen, Carsten Dominik
* lisp/org-clock.el (org-clocktable-write-default):
---
Hi,
My agenda clock reports were not displaying total file time correctly anymore.
Since the patch for adding properties used up a placeholder when no properties are
provided there was no place to put the total file time into the summary line.
I'm not completely sure the placeholder is in the right place for this but this works for me.
Please double check before applying.
This patch is available at git://git.norang.ca/org-mode.git fix-clock-report-file-time
Regards,
Bernt
lisp/org-clock.el | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index a3caa48..8d00c0a 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2162,9 +2162,9 @@ from the dynamic block defintion."
(insert-before-markers "|-\n") ; a hline because a new file starts
;; First the file time, if we have multiple files
(when multifile
- ;; Summarize the time colleted from this file
+ ;; Summarize the time collected from this file
(insert-before-markers
- (format (concat "| %s %s | %s*" (nth 8 lwords) "* | *%s*|\n")
+ (format (concat "| %s %s | %s*" (nth 8 lwords) "* | %s *%s*|\n")
(file-name-nondirectory (car tbl))
(if level-p "| " "") ; level column, maybe
(if timestamp "| " "") ; timestamp column, maybe
--
1.7.6.rc0.12.g2c6b5
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2011-06-08 19:42 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-26 20:29 lisp/org-clock.el: Add param :properties to list properties in clocktable Niels Giesen
2011-03-26 20:49 ` Bernt Hansen
2011-03-27 10:13 ` Niels Giesen
2011-03-27 12:13 ` Bernt Hansen
2011-03-28 18:24 ` Niels Giesen
2011-05-02 9:33 ` Carsten Dominik
2011-05-13 8:00 ` Niels Giesen
2011-05-13 8:03 ` Carsten Dominik
2011-05-13 12:19 ` [Accepted] " Carsten Dominik
2011-06-08 19:41 ` [PATCH] Fix reported file time for clock reports Bernt Hansen
2011-05-13 12:20 ` lisp/org-clock.el: Add param :properties to list properties in clocktable Carsten Dominik
2011-05-13 12:35 ` Giovanni Ridolfi
2011-05-18 7:08 ` Niels Giesen
2011-05-18 8:43 ` Giovanni Ridolfi
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).