emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: Accessing CATEGORY for custom agenda command


From: Markus Heller
Subject: [Orgmode] Re: Accessing CATEGORY for custom agenda command
Date: Fri, 11 Feb 2011 15:28:37 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt)

Bastien <address@hidden> writes:

> Hi Markus,
>
> Markus Heller <address@hidden> 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




reply via email to

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