emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: property matching in org-agenda-custom-commands
Date: Fri, 05 Apr 2019 14:39:14 -0400	[thread overview]
Message-ID: <87lg0oqotp.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: CAN_Dec-kPyagJ5sChNDMQW36O0ecVS7Baa3EgDxvM8R8umEVxw@mail.gmail.com

Matt Price <moptop99@gmail.com> writes:

> Embarassed that I still don't really know how to use the agenda commands after all this time :-(

Ditto - I need to read the doc for org-agenda-custom-commands every
time I try to use it.

>
> I have a bunch of trees that look in part like this:
> * Asisgnment 1
> ** Student A
> :PROPERTIES:
> :GRADE: 0
> :END:
> I would like to store a search in org-agenda-custom-commands. I generated it initially with ~C-c a < m
> +GRADE="0"~. Now I have tried to store it in org-agenda-custom-commands with this line:
>
> ("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")
>
> However, this seems to choke, and the agenda is not generated. There are no error messages in *Messages*
> so I'm not quite sure what's going on.  Can anyone see obvious mistakes in my syntax?
>
> Thank you!
>

This looks right and it also seems to work correctly for me.

One thing to note is the doc for tags-tree:

,----
|           tags-tree   Sparse tree with all tags matches in *current* file.
`----

so you need to be visiting the file.

Here's what I did:

I added it to the end of org-agenda-custom-commands with

(add-to-list 'org-agenda-custom-commands
             '("F" "Failing Students in Current Buffer Only" tags-tree "+GRADE=\"0\"")
             t)

then added a bunch of entries to an org file:

--8<---------------cut here---------------start------------->8---
* Asisgnment 1
** Student A
:PROPERTIES:
:GRADE: 0
:END:
** Student B
:PROPERTIES:
:GRADE: 1
:END:
** Student C
:PROPERTIES:
:GRADE: 0
:END:
** Student D
:PROPERTIES:
:GRADE: 2
:END:
** Student E
:PROPERTIES:
:GRADE: 0
:END:
** Student F
:PROPERTIES:
:GRADE: 3
:END:
--8<---------------cut here---------------end--------------->8---

Then while visiting this file, I did

C-c a F

I get a sparse tree with the headings for students A, C and E.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

  reply	other threads:[~2019-04-05 19:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 17:31 property matching in org-agenda-custom-commands Matt Price
2019-04-05 18:39 ` Nick Dokos [this message]
2019-04-05 20:16 ` Thomas Plass
2019-04-06  1:26   ` Matt Price
2019-04-06  9:06     ` Thomas Plass

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=87lg0oqotp.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@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).