Hi orgees, In March I had a go at making a "Remaining work/progress report"[1]. Having make some progress, I am looking for:
- help,
- collaborators,
- opinions on whether this would be useful enough to be worth the
effort,
- whether anyone else has something like this (but better) and
- any other wisdom,
with a view to contributing it.
Table of Contents
_________________
1 Features
2 Usage
3 How it works
4 Improvements necessary to make it truly useful
1 Features
~~~~~~~~~~
Attachments: minimal.el my-progress.el a.org b.org
Currently it can make a table consisting of a mixture of the Table of
Contents (TOC) entries and the inline tasks within each section, e.g.:
ITEM Effort CLOCKSUM Remaining
------------------------------------------------------------
.1 Heading One 1:25
... 1.1 A sub heading 0:36
. Draw a figure 1:00 0:36 0:24
... 1.2 Another sub heading 0:49
. Write this bit 1:20 0:49 0:31
Most of the code was available from various places so there is not
much original work from me in this.
2 Usage
~~~~~~~
- start emacs: emacs -Q -l minimal.el a.org
- excute the emacs-lisp source blocks
- refresh the "Remaining" properties:
goto each property and press C-c s RET RET
- Execute the dynamic block C-c c in "Progress table"
3 How it works
~~~~~~~~~~~~~~
Whenever a task is clocked in to, the value of a new "Effort" property
is prompted for. When the task is clocked out of, a new property
"Remaining" is added that is the difference of Effort special property
CLOCKSUM.
The buffer is exported ascii-like to get the TOC with its headline
numbering, and is matched with corresponding lines of the captured
column view.
4 Improvements necessary to make it truly useful
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. include a captured column view of the INCLUDEd file b.org: the file's
headings are included in the TOC because it uses the new exporter, but
not in the column-view. Maybe exporting as org first and then
taking the column view of that buffer would work.
2. Accumulate the time Remaining in the same way that CLOCKSUM does;
it propagates upwards to higher level headings so that you can see
(e.g.) how long Chapter 1 will take in total
3. Refresh all the Remaining properties automatically
I would really appreciate some help, particularly with 1.
Thanks,
Myles
Footnotes:
[1] http://comments.gmane.org/gmane.emacs.orgmode/53567
minimal.el
Description: application/emacs-lisp
my-progress.el
Description: application/emacs-lisp
#+COLUMNS: %50ITEM %5Effort %5CLOCKSUM %5Remaining
#+BEGIN_SRC emacs-lisp
;; (unload-feature 'my-progress)
;; (setq org-clock-in-prepare-hook nil
;; org-clock-out-hook nil
;; org-export-filter-final-output-functions nil)
(load (concat default-directory "my-progress.el") nil t t)
(add-to-list 'org-export-filter-final-output-functions
'my-progress-remove-toc-heading)
#+END_SRC
#+BEGIN_SRC emacs-lisp
(setq org-properties-postprocess-alist
'(("Remaining" lambda(value)
(let ((clocksum (org-clock-sum-current-item))
(effort (org-duration-string-to-minutes
(org-entry-get (point) "Effort"))))
(org-minutes-to-hh:mm-string (- effort clocksum))))))
(require 'org-inlinetask)
(add-hook 'org-clock-in-prepare-hook 'my-progress-org-mode-ask-effort 'append)
(add-hook 'org-clock-out-hook
(lambda () (org-set-property "Remaining" 0)) 'append)
#+END_SRC
* Heading One
** A sub heading
*************** TODO Inline ting
CLOCK: [2012-10-10 Wed 11:07]--[2012-10-10 Wed 11:34] => 0:27
CLOCK: [2012-10-10 Wed 10:55]--[2012-10-10 Wed 11:04] => 0:09
:PROPERTIES:
:Effort: 1:00
:Remaining: 0:51
:END:
*************** END
** Another sub heading
*************** TODO Write this bit
CLOCK: [2012-10-10 Wed 11:10]--[2012-10-10 Wed 11:59] => 0:49
:PROPERTIES:
:Effort: 1:20
:Remaining: 0:31
:END:
*************** END
** Heading with no inline tasks
*** a
This heading could be omitted because it has no tasks.
* Heading Two
*************** TODO Finish writing under heading two
*************** END
** Sub heading that will show up in the table
*** Will this one?
*************** TODO Test
CLOCK: [2012-10-10 Wed 11:55]--[2012-10-10 Wed 11:56] => 0:01
CLOCK: [2012-10-10 Wed 11:50]--[2012-10-10 Wed 11:54] => 0:04
:PROPERTIES:
:Effort: 0:20
:Remaining: 0:14
:END:
*************** END
**** And this?
** Yet another subheading
*** A sub sub heading
And an inline task:
*************** TODO Do an inline thing
CLOCK: [2012-10-10 Wed 11:45]--[2012-10-10 Wed 11:50] => 0:05
:PROPERTIES:
:Remaining: 0:15
:Effort: 0:20
:END:
*************** END
*** Another sub sub heading
**** This heading contains no tasks
...and so will not appear in the progress table.
#+INCLUDE: "b.org" :minlevel 1
* Progress table
#+name: progressTbl
#+BEGIN: columnview-toc :id file:/home/myles/tmp/toctbl/mwe/a.org
| ITEM | Effort | CLOCKSUM |
Remaining | |
|----------------------------------------------------+--------+----------+-----------+---|
| .1 Heading One | | 1:25 |
| |
| ... 1.1 A sub heading | | 0:36 |
| |
| . Inline ting | 1:00 | 0:36 |
0:51 | |
| ... 1.2 Another sub heading | | 0:49 |
| |
| . Write this bit | 1:20 | 0:49 |
0:31 | |
| ... 1.3 Heading with no inline tasks | | |
| |
| ...... 1.3.1 a | | |
| |
| .2 Heading Two | | 0:10 |
| |
| . Finish writing under heading two | | |
| |
| ... 2.1 Sub heading that will show up in the table | | 0:05 |
| |
| ...... 2.1.1 Will this one? | | 0:05 |
| |
| . Test | 0:20 | 0:05 |
0:14 | |
| ... 2.2 Yet another subheading | | 0:05 |
| |
| ...... 2.2.1 A sub sub heading | | 0:05 |
| |
| . Do an inline thing | 0:20 | 0:05 |
0:15 | |
| ...... 2.2.2 Another sub sub heading | | |
| |
| .5 Progress table | | |
| |
|----------------------------------------------------+--------+----------+-----------+---|
| Total time [H:M]: | 1:35 | |
| |
#+END:
#+BEGIN_SRC elisp
(org-export-as 'my-progress-toc)
#+END_SRC
#+RESULTS:
#+begin_example
1 Heading One
.. 1.1 A sub heading
.. 1.2 Another sub heading
.. 1.3 Heading with no inline tasks
..... 1.3.1 a
2 Heading Two
.. 2.1 Sub heading that will show up in the table
..... 2.1.1 Will this one?
.. 2.2 Yet another subheading
..... 2.2.1 A sub sub heading
..... 2.2.2 Another sub sub heading
3 Heading Three of main doc
.. 3.1 An included sub heading
.. 3.2 Yet another included subheading
..... 3.2.1 An included sub sub heading
4 Heading Four
5 Progress table
#+end_example
* Heading Three of main doc
** An included sub heading
** Yet another included subheading
*** An included sub sub heading
And an inline task:
*************** TODO Yet More Do an included inline thing
CLOCK: [2012-10-10 Wed 12:42]--[2012-10-10 Wed 13:42] => 1:00
:PROPERTIES:
:Effort: 1:30
:Remaining: 0:30
:END:
*************** END
* Heading Four
*************** TODO Finish writing under included heading two
*************** END
