From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Heller Subject: Re: Accessing CATEGORY for custom agenda command Date: Fri, 11 Feb 2011 15:28:37 -0800 Message-ID: <0vpqqycfru.fsf@gmail.com> References: <0vtygacs6z.fsf@gmail.com> <87r5be4ays.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=44226 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Po2Q8-0001on-0m for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 18:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Po2Q3-0005Uu-Uz for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 18:28:56 -0500 Received: from lo.gmane.org ([80.91.229.12]:41713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Po2Q3-0005Uq-Jn for emacs-orgmode@gnu.org; Fri, 11 Feb 2011 18:28:55 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Po2Q1-0004kb-FV for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 00:28:53 +0100 Received: from 142.103.191.98 ([142.103.191.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Feb 2011 00:28:53 +0100 Received: from hellerm2 by 142.103.191.98 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Feb 2011 00:28:53 +0100 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 Bastien writes: > 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 :) Hi Bastien, thanks for you reply. Yup, makes me feel better, because I think I'm beginning to understand how to use properties more effectively. Cheers Markus