From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Custom agenda views Date: Sun, 28 Oct 2007 10:46:33 +0000 Message-ID: <87640ttz1q.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Im4jE-0006CG-0u for emacs-orgmode@gnu.org; Sun, 28 Oct 2007 05:46:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Im4jC-0006C4-IQ for emacs-orgmode@gnu.org; Sun, 28 Oct 2007 05:46:43 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Im4jC-0006C1-FW for emacs-orgmode@gnu.org; Sun, 28 Oct 2007 05:46:42 -0400 Received: from fk-out-0910.google.com ([209.85.128.191]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Im4jB-0004lX-SX for emacs-orgmode@gnu.org; Sun, 28 Oct 2007 05:46:42 -0400 Received: by fk-out-0910.google.com with SMTP id 19so1644841fkr for ; Sun, 28 Oct 2007 02:46:40 -0700 (PDT) In-Reply-To: (Dave C. Nelson's message of "Fri, 26 Oct 2007 09:20:11 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Dave C. Nelson" 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