emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Remaining work/progress report: nearly useful, help needed


From: Myles English
Subject: Re: [O] Remaining work/progress report: nearly useful, help needed
Date: Sat, 13 Oct 2012 02:48:10 +0100
User-agent: mu4e 0.9.9-dev6; emacs 24.2.1

Attachment: my-progress.el
Description: application/emacs-lisp

I have a solution that does everything I need apart from exclude DONE
items from the CLOCKSUM property.  Writing it here for posterity.

I get a table like this (Note: the "0:08" is from a DONE task that is
excluded from the table and the other property columns):

#+BEGIN: columnview-toc :id file:a.org
| ITEM                                               | Effort | CLOCKSUM | 
Remaining |   |
|----------------------------------------------------+--------+----------+-----------+---|
| .1 Heading One                                     |   3:28 |     1:13 |      
2:23 |   |
| ... 1.1 First heading                              |        |          |      
     |   |
| ... 1.2 A sub heading                              |        |     0:08 |      
     |   |
| ... 1.3 Another sub heading                        |        |     1:05 |      
     |   |
| .        Write this bit                            |   1:20 |     0:50 |      
0:30 |   |
| .        Do something                              |   1:23 |     0:05 |      
1:18 |   |
| .        This bit too                              |   0:45 |     0:10 |      
0:35 |   |
| ... 1.4 Heading with no inline tasks               |        |          |      
     |   |
| ...... 1.4.1 a                                     |        |          |      
     |   |
| .2 Heading Two                                     |   0:40 |     0:12 |      
0:33 |   |
| .   Finish writing under heading two               |        |          |      
     |   |
| ... 2.1 Sub heading that will show up in the table |   0:20 |     0:05 |      
0:14 |   |
| ...... 2.1.1 Will this one?                        |   0:20 |     0:05 |      
0:14 |   |
| .             Test                                 |   0:20 |     0:05 |      
0:14 |   |
| ... 2.2 Yet another subheading                     |   0:20 |     0:07 |      
0:19 |   |
| ...... 2.2.1 A sub sub heading                     |        |     0:07 |      
     |   |
| .             Do an inline thing                   |   0:20 |     0:07 |      
0:19 |   |
| ...... 2.2.2 Another sub sub heading               |        |          |      
     |   |
| .3 Heading Three of main doc                       |   2:28 |     1:00 |      
0:30 |   |
| ... 3.1 An included sub heading                    |        |          |      
     |   |
| ... 3.2 Yet another included subheading            |   2:28 |     1:00 |      
0:30 |   |
| ...... 3.2.1 An included sub sub heading           |        |     1:00 |      
     |   |
| .             Yet More Do an included inline thing |   1:30 |     1:00 |      
0:30 |   |
| .4 Heading Four                                    |        |     0:06 |      
     |   |
| .   Finish writing under included heading two      |        |          |      
     |   |
| .   Somethingorother                               |   0:58 |     0:06 |      
     |   |
| .5 Progress table                                  |        |          |      
     |   |
|----------------------------------------------------+--------+----------+-----------+---|
| Total time [H:M]:                                  |   6:36 |          |      
3:26 |   |

#+END:

By using the attached library (my-progress.el), having these columns
defined:

#+COLUMNS: %5ITEM %5Effort{:} %5CLOCKSUM %5Remaining{:}

and using this config:

;; ----------------------------- BEGIN my-progress.el --------
(add-to-list 'load-path "~/lib/lisp")
(require 'my-progress)
(add-to-list 'org-export-filter-final-output-functions
             'my-progress-remove-toc-heading)
(add-to-list 'org-properties-postprocess-alist
             '("Remaining" lambda(value)
               (let ((clocksum (org-duration-string-to-minutes
                                (my-get-clock-sum)))
                     (effort (org-duration-string-to-minutes
                              (org-entry-get (point) "Effort"))))
                 (org-minutes-to-hh:mm-string (- effort clocksum)))))

(add-hook 'org-clock-in-prepare-hook
          'my-progress-org-mode-ask-effort 'append)

(add-hook 'org-clock-out-hook
          (lambda ()
            (org-set-property my-progress-remaining-property 0))
          'append)

(add-hook 'org-after-todo-state-change-hook
          'my-progress-rename-properties)
;; ----------------------------- END my-progress.el ----------

Myles

reply via email to

[Prev in Thread] Current Thread [Next in Thread]