* Karl Voit <[email protected]> wrote:
> Hi!
>
> I want a custom agenda that lists all headings (not necessarily with
> a state like TODO or NEXT) which are tagged with :borrowed: but
> which are not in state DONE or CANCELED.
Following works thanks to Memnon Anon:
,----[ section within org-agenda-custom-commands ]
| ("b" "borrowed stuff" tags "+borrowed" (
| (org-agenda-overriding-header "stuff that I borrowed")
| (org-agenda-skip-function 'tag-without-done-or-canceled)
| ))
`----
,----[ you function ]
| (defun tag-without-done-or-canceled ()
| "Show items with tag \"borrowed\" that are neither in \"DONE\" or
\"CANCELED \" state."
| (let ((state (org-entry-get (point) "TODO")))
| (if (and (member "borrowed" (org-get-tags-at (point)))
| (not (string= state "DONE"))
| (not (string= state "CANCELED")))
| nil ; do not skip
| (line-end-position)))) ; skip
`----
Thanks very much! Very handy to me!
One little thing: there are not items listed that inherit the
«borrowed» tag from any higher level heading. But I guess this is
something that could not be done easily in this case. Right?
--
Karl Voit