emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Custom agenda views


From: Bastien
Subject: Re: [Orgmode] Custom agenda views
Date: Sun, 28 Oct 2007 10:46:33 +0000
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux)

"Dave C. Nelson" <address@hidden> writes:

> What I want is to have an agenda view like the default agenda view one
> gets with c-a a, but "narrowed" so that only a subset of todo items
> show. For example, when I'm at work, I want to narrow the agenda view
> so that it only shows todo items related to work.

What about using agenda blocks[1]?

(org-add-agenda-custom-command
      '("v" "Agenda and Work-related tasks"
        ((tags-todo "WORK")
         (agenda))))

If you just want to use the agenda block and select entries in it, you
can do this with `org-agenda-skip-function'[2]:

(org-add-agenda-custom-command
      '("v" agenda "PROJECT"
        ((org-agenda-skip-function 'my-skip-unless-work)
         (org-agenda-overriding-header "Projects related to work: "))))

(defun my-skip-unless-work ()
       "Skip trees that are not tagged as :WORK:"
       (let ((subtree-end (save-excursion (org-end-of-subtree t))))
         (if (re-search-forward ":WORK:" subtree-end t)
             nil          ; tag found, do not skip
           subtree-end))) ; tag not found, continue after end of subtree

HTH,

Notes: 
[1]  See (info "(org)Block agenda")
[2]  See (info "(org)Special agenda views")

-- 
Bastien




reply via email to

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