From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: property matching in org-agenda-custom-commands Date: Fri, 05 Apr 2019 14:39:14 -0400 Message-ID: <87lg0oqotp.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCUEO-0007Ic-7J for emacs-orgmode@gnu.org; Fri, 05 Apr 2019 15:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCUEE-0000PF-Kv for emacs-orgmode@gnu.org; Fri, 05 Apr 2019 15:10:23 -0400 Received: from [195.159.176.226] (port=55806 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hCUDW-0006mX-Dg for emacs-orgmode@gnu.org; Fri, 05 Apr 2019 15:10:04 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hCTkK-000ocn-Si for emacs-orgmode@gnu.org; Fri, 05 Apr 2019 20:39:24 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Matt Price 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