From: Markus Heller <hellerm2@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Accessing CATEGORY for custom agenda command
Date: Fri, 11 Feb 2011 15:28:37 -0800 [thread overview]
Message-ID: <0vpqqycfru.fsf@gmail.com> (raw)
In-Reply-To: 87r5be4ays.fsf@gnu.org
Bastien <bastien.guerry@wikimedia.fr> writes:
> Hi Markus,
>
> Markus Heller <hellerm2@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
next prev parent reply other threads:[~2011-02-11 23:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-11 19:00 Accessing CATEGORY for custom agenda command Markus Heller
2011-02-11 19:39 ` Bastien
2011-02-11 23:28 ` Markus Heller [this message]
2011-03-18 23:10 ` Matt Lundin
2011-03-21 20:32 ` Markus Heller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0vpqqycfru.fsf@gmail.com \
--to=hellerm2@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).