From: Bastien <bastien.guerry@wikimedia.fr>
To: Markus Heller <hellerm2@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Accessing CATEGORY for custom agenda command
Date: Fri, 11 Feb 2011 20:39:39 +0100 [thread overview]
Message-ID: <87r5be4ays.fsf@gnu.org> (raw)
In-Reply-To: <0vtygacs6z.fsf@gmail.com> (Markus Heller's message of "Fri, 11 Feb 2011 11:00:20 -0800")
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 :)
--
Bastien
next prev parent reply other threads:[~2011-02-11 19:39 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 [this message]
2011-02-11 23:28 ` Markus Heller
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=87r5be4ays.fsf@gnu.org \
--to=bastien.guerry@wikimedia.fr \
--cc=emacs-orgmode@gnu.org \
--cc=hellerm2@gmail.com \
/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).