[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] property matching in org-agenda-custom-commands
From: |
Nick Dokos |
Subject: |
Re: [O] property matching in org-agenda-custom-commands |
Date: |
Fri, 05 Apr 2019 14:39:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Matt Price <address@hidden> 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