Bastien <bastien.gue...@wikimedia.fr> writes:

> Hi Markus,
>
> Markus Heller <helle...@gmail.com> 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


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to