From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Accessing CATEGORY for custom agenda command Date: Fri, 11 Feb 2011 20:39:39 +0100 Message-ID: <87r5be4ays.fsf@gnu.org> References: <0vtygacs6z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=44902 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnyqA-0003KN-JY for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:39:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnyq8-0004iB-Pf for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:39:38 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:41919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnyq8-0004hx-IW for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 14:39:36 -0500 Received: by bwz16 with SMTP id 16so3512032bwz.0 for ; Fri, 11 Feb 2011 11:39:35 -0800 (PST) In-Reply-To: <0vtygacs6z.fsf@gmail.com> (Markus Heller's message of "Fri, 11 Feb 2011 11:00:20 -0800") 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: Markus Heller Cc: emacs-orgmode@gnu.org Hi Markus, Markus Heller writes: > I'm trying to get the following to work: > > (org-add-agenda-custom-command > '("X" tags "Task" > ((org-agenda-skip-function '(org-agenda-skip-entry-if > 'notregexp "Admin")) > (org-agenda-overriding-header " Test")))) > > > I want all entries that have the tag "TASK" and that have the category > "Admin" shown in the agenda. > > I set the category in my org files like this: > > #+CATEGORY: Admin > #+FILETAGS: ADMIN > * Tasks [5/6] :TASK: > ** TODO Drop off Stuff > ** DONE F'up on other stuff Two problems: - the tag is "TASK" and your custom agenda command looks for "Task": beware of the case - '(org-agenda-skip-entry-if 'notregexp "Admin") is looking for an actual occurrence of the string "Admin" in the subtree -- and there is no such occurrence in your .org example. I suggest you use the CATEGORY property like this: ,---- | #+FILETAGS: ADMIN | | * Tasks [5/6] :Task: | :PROPERTIES: | :CATEGORY: Admin | :END: | | ** TODO Drop off Stuff | ** DONE F'up on other stuff `---- With this file, your agenda custom command works. > I also tried using 'notregexp "ADMIN" to go after the FILETAG, but > either way, the search yields no hits. No, 'notregexp will go after actual text in the subtree, not inherited properties. If you look for properties, try org-entry-get instead in a org-agenda-skip-function instead. > I have the feeling that I'm misunderstanding something pretty badly and > would appreciate any help :-) Hope you feel better :) -- Bastien