emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Overview of agenda files
@ 2008-09-24 11:28 Vladi Solutka
  2008-09-26 16:10 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Vladi Solutka @ 2008-09-24 11:28 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

First: Thanks for orgmode! Didn't know that it would be possible to
love my emacs even more :-))

After I'd watched Dominiks Google Talk about org-mode (thanks for
that, very interesting), I started to organize my stuff in a more
"information centric" way. It looks like this is a very good approach
especially when handling small, but long running projects.

All I currently miss is the possibility to have a top overview of my
projects, listing the count of the different keywords (since each
project has its own file, this would be in fact an overview of my
agenda files). This would give me a quick overview of the status of
each project and would be a perfect starting point when
checking/digging into my projects, especially if the counts and
filenames would be links ...

Example:

|-------+------+------+-------|
| File  | TODO | WAIT | LATER |
|-------+------+------+-------|
| File1 |    5 |    2 |    10 |
| File2 |    2 |    2 |       |
| File3 |   12 |    0 |     0 |
|-------+------+------+-------|


Did anyone something like that before? Or is this maybe already
possible with orgmode?

Thanks!
--- \\/ladi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Overview of agenda files
  2008-09-24 11:28 Overview of agenda files Vladi Solutka
@ 2008-09-26 16:10 ` Carsten Dominik
  2008-09-28 20:39   ` Vladi Solutka
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2008-09-26 16:10 UTC (permalink / raw)
  To: Vladi Solutka; +Cc: emacs-orgmode

Hi Vladi,

On Sep 24, 2008, at 1:28 PM, Vladi Solutka wrote:

> Hi!
>
> First: Thanks for orgmode! Didn't know that it would be possible to
> love my emacs even more :-))
>
> After I'd watched Dominiks Google Talk about org-mode (thanks for
> that, very interesting), I started to organize my stuff in a more
> "information centric" way. It looks like this is a very good approach
> especially when handling small, but long running projects.
>
> All I currently miss is the possibility to have a top overview of my
> projects, listing the count of the different keywords (since each
> project has its own file, this would be in fact an overview of my
> agenda files). This would give me a quick overview of the status of
> each project and would be a perfect starting point when
> checking/digging into my projects, especially if the counts and
> filenames would be links ...
>
> Example:
>
> |-------+------+------+-------|
> | File  | TODO | WAIT | LATER |
> |-------+------+------+-------|
> | File1 |    5 |    2 |    10 |
> | File2 |    2 |    2 |       |
> | File3 |   12 |    0 |     0 |
> |-------+------+------+-------|
>
>
> Did anyone something like that before? Or is this maybe already
> possible with orgmode?

There is nothing built-in to make something like this, but using  
dynamic blocks and the entry mapper, it can be implemented compactly.

Load the following code, in .emacs or so....

(defun org-dblock-write:count-todo-states (params)
  (let ((states (or (plist-get params :states) '("TODO")))
	table file entry tbl)
    ;; Map over all entries
    (apply 'org-map-entries 'my-count-todo-states-internal
	   nil 'agenda params)
    (setq table (nreverse table))
    ;; Insert headline
    (insert "|File|" (mapconcat 'identity states "|") "|\n|-")
    ;; Insert the counts
    (while (setq entry (pop table))
      (setq file (car entry) tbl (cdr entry))
      (insert "\n|[[file:" file "][" (file-name-nondirectory file) "]]|"
	      (mapconcat (lambda (x) (number-to-string
				      (or (cdr (assoc x tbl)) 0)))
			 states "|")
	      "|"))
    ;; Align the table
    (org-table-align)))

(defun my-count-todo-states-internal ()
  "Count TODO keywords per file, into dynamically scoped variable  
`table'."
  (let ((todo (org-get-todo-state))
	(bfn (buffer-file-name))
	a a1)
    (if (not (assoc bfn table))
        ;; Add entry for this new file name
	(push (list bfn) table))
    (setq a (assoc bfn table))
    (if (not (assoc todo (cdr a)))
        ;; Add entry for this new TODO keyword
	(setcdr a (cons (cons todo 0) (cdr a))))
    (setq a1 (assoc todo (cdr a)))
    (setcdr a1 (1+ (cdr a1)))))


Then put the following two lines into an Org-mode buffer

#+BEGIN: count-todo-states :states ("TODO" "WAIT" "LATER")
#+END: count-todo-states

Each time you press `C-c C-c' on te BEGIN line, the table you are  
looking for
will be updated between these two lines.  I have made the file names  
links,
I am not sure what you mean by making links of the counts.....

HTH

- Carsten

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Overview of agenda files
  2008-09-26 16:10 ` Carsten Dominik
@ 2008-09-28 20:39   ` Vladi Solutka
  2008-09-29  3:09     ` Manish
  0 siblings, 1 reply; 6+ messages in thread
From: Vladi Solutka @ 2008-09-28 20:39 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

Carsten Dominik <dominik <at> uva.nl> writes:

> > All I currently miss is the possibility to have a top overview of my
> > projects, listing the count of the different keywords (since each
> > project has its own file, this would be in fact an overview of my
> > agenda files). 

[...]

> There is nothing built-in to make something like this, but using  
> dynamic blocks and the entry mapper, it can be implemented compactly.
> 
> Load the following code, in .emacs or so....

[...]

Wow, thanks alot :-) I thought about writing an external script since
I don't really know too much about lisp, but I definitely prefer a 
'native' solution. Unfortunately I get a 

Lisp error: (void-variable my-count-todo-states-internal)

Stack trace:
(lambda nil my-count-todo-states-internal)()
 org-scan-tags(my-count-todo-states-internal t)
 org-map-entries(my-count-todo-states-internal nil agenda :name
"count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n" 0 1
(fontified t)))
 apply(org-map-entries my-count-todo-states-internal nil agenda (:name
"count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n" 0 1
(fontified t))))
 org-dblock-write:count-todo-states((:name "count-todo-states" :states ("TODO"
"WAIT" "LATER") :content #("\n" 0 1 (fontified t))))


I had a look into the code but got somewhat lost, sorry ... :-|
(BTW currently I use emacs 22.3 on windows).

> I have made the file names links,
> I am not sure what you mean by making links of the counts.....

I thought about making the count numbers links that automagically 
open the corresponding file and execute a sparse todo-tree command; 
this would help to ie quickly view all my 'WAITING' entries (complete 
w/ context) of a specific project. 

I was also hoping the be able to (a) differentiate in the 
overview between scheduled and unscheduled (kind of 'open') entries and 
(b) to open sparse trees only showing these unscheduled entries (see my 
other post "custom commands 'todo-tree' and org-agenda-skip-function").

Anyway, thanks very much for all your effort!

--- \\/ladi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Overview of agenda files
  2008-09-28 20:39   ` Vladi Solutka
@ 2008-09-29  3:09     ` Manish
  2008-09-29  5:51       ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Manish @ 2008-09-29  3:09 UTC (permalink / raw)
  To: Vladi Solutka; +Cc: emacs-orgmode

  On Mon, Sep 29, 2008 at 2:09 AM, Vladi Solutka wrote:
  > Hi!
  >
  > Carsten Dominik writes:
  >
  >> > All I currently miss is the possibility to have a top overview of my
  >> > projects, listing the count of the different keywords (since each
  >> > project has its own file, this would be in fact an overview of my
  >> > agenda files).
  >
  > [...]
  >
  >> There is nothing built-in to make something like this, but using
  >> dynamic blocks and the entry mapper, it can be implemented compactly.
  >>
  >> Load the following code, in .emacs or so....
  >
  > [...]
  >
  > Wow, thanks alot :-) I thought about writing an external script since
  > I don't really know too much about lisp, but I definitely prefer a
  > 'native' solution. Unfortunately I get a
  >
  > Lisp error: (void-variable my-count-todo-states-internal)
  >
  > Stack trace:
  > (lambda nil my-count-todo-states-internal)()
  >  org-scan-tags(my-count-todo-states-internal t)
  >  org-map-entries(my-count-todo-states-internal nil agenda :name
  > "count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n" 0 1
  > (fontified t)))
  >  apply(org-map-entries my-count-todo-states-internal nil agenda (:name
  > "count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n" 0 1
  > (fontified t))))
  >  org-dblock-write:count-todo-states((:name "count-todo-states"
:states ("TODO"
  > "WAIT" "LATER") :content #("\n" 0 1 (fontified t))))
  >

FWIW, it worked for me (Thanks Carsten.)  I eval'ed the two functions
and added this to an .org file:

,----
| #+BEGIN: count-todo-states :states ("TODO" "APPT" "NEXT" "WAITING" "DONE" )
| #+END: count-todo-states
`----

and did a C-c C-c on the lines to get the summary table.

-- Manish

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Overview of agenda files
  2008-09-29  3:09     ` Manish
@ 2008-09-29  5:51       ` Carsten Dominik
  2008-10-01 17:01         ` Vladi Solutka
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2008-09-29  5:51 UTC (permalink / raw)
  To: Manish; +Cc: emacs-orgmode


On Sep 29, 2008, at 5:09 AM, Manish wrote:

>  On Mon, Sep 29, 2008 at 2:09 AM, Vladi Solutka wrote:
>> Hi!
>>
>> Carsten Dominik writes:
>>
>>>> All I currently miss is the possibility to have a top overview of  
>>>> my
>>>> projects, listing the count of the different keywords (since each
>>>> project has its own file, this would be in fact an overview of my
>>>> agenda files).
>>
>> [...]
>>
>>> There is nothing built-in to make something like this, but using
>>> dynamic blocks and the entry mapper, it can be implemented  
>>> compactly.
>>>
>>> Load the following code, in .emacs or so....
>>
>> [...]
>>
>> Wow, thanks alot :-) I thought about writing an external script since
>> I don't really know too much about lisp, but I definitely prefer a
>> 'native' solution. Unfortunately I get a
>>
>> Lisp error: (void-variable my-count-todo-states-internal)
>>
>> Stack trace:
>> (lambda nil my-count-todo-states-internal)()
>> org-scan-tags(my-count-todo-states-internal t)
>> org-map-entries(my-count-todo-states-internal nil agenda :name
>> "count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n"  
>> 0 1
>> (fontified t)))
>> apply(org-map-entries my-count-todo-states-internal nil agenda (:name
>> "count-todo-states" :states ("TODO" "WAIT" "LATER") :content #("\n"  
>> 0 1
>> (fontified t))))
>> org-dblock-write:count-todo-states((:name "count-todo-states"
> :states ("TODO"
>> "WAIT" "LATER") :content #("\n" 0 1 (fontified t))))
>>
>
> FWIW, it worked for me



Hi Manish, thanks for checking.

It turns out that I had to fix a little bug to make this hack it work,  
obviously you already pulled the latest version before you tried.

So yes, Vladi, you need to either get the git version or wait for the  
6.08 release.

- Carsten

> (Thanks Carsten.)  I eval'ed the two functions
> and added this to an .org file:
>
> ,----
> | #+BEGIN: count-todo-states :states ("TODO" "APPT" "NEXT" "WAITING"  
> "DONE" )
> | #+END: count-todo-states
> `----
>
> and did a C-c C-c on the lines to get the summary table.
>
> -- Manish
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Overview of agenda files
  2008-09-29  5:51       ` Carsten Dominik
@ 2008-10-01 17:01         ` Vladi Solutka
  0 siblings, 0 replies; 6+ messages in thread
From: Vladi Solutka @ 2008-10-01 17:01 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

Carsten Dominik <dominik <at> uva.nl> writes:

> >> Lisp error: (void-variable my-count-todo-states-internal)

> It turns out that I had to fix a little bug to make this hack it work,  
> obviously you already pulled the latest version before you tried.
> 
> So yes, Vladi, you need to either get the git version or wait for the  
> 6.08 release.

I pulled the git version and it works - thanks alot! :-)

--- \\/ladi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-01 17:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-24 11:28 Overview of agenda files Vladi Solutka
2008-09-26 16:10 ` Carsten Dominik
2008-09-28 20:39   ` Vladi Solutka
2008-09-29  3:09     ` Manish
2008-09-29  5:51       ` Carsten Dominik
2008-10-01 17:01         ` Vladi Solutka

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).