emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Custom agenda: search by tag and exclude DONE items


From: Karl Voit
Subject: Re: [O] Custom agenda: search by tag and exclude DONE items
Date: Sun, 9 Dec 2012 22:05:52 +0100
User-agent: slrn/0.9.9 (Linux)

* Karl Voit <address@hidden> 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




reply via email to

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