From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: Question on org-agenda-custom-commands tags-todo match syntax Date: Sat, 12 Jan 2019 12:02:42 -0500 Message-ID: <87k1j9x0zx.fsf@kyleam.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:50841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giMrY-0003kw-Ru for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 12:14:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giMgS-0001XD-1M for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 12:02:56 -0500 Received: from pb-smtp20.pobox.com ([173.228.157.52]:54377) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giMgR-0001Ve-DB for emacs-orgmode@gnu.org; Sat, 12 Jan 2019 12:02:55 -0500 In-Reply-To: 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: Niall Dooley , emacs-orgmode@gnu.org Niall Dooley writes: > (setq org-agenda-custom-commands > '(("p" "List Non-done projects" > tags-todo "-CANCELLED+PROJECT/!+TODO"))) > > My understanding is that in the tags-todo match that entries to the left = of > the "/" are the tags, those to the right are the todo keywords and that y= ou > use a "+" to indicate a condition should be satisfied and a "-" when it > should > not be satisfied. Is this correct? That sounds right, though I often forget the details of the match syntax and have to look it up. It=E2=80=99s described at (info "(org)Matching tags and properties") The "/" syntax you refer to is talked about at the very end of that page. > So in the above snippet the search matches headlines with the tag :PROJEC= T: > and not :CANCELLED: and a todo keyword of TODO. With this I have the > following > questions which I would appreciate if someone could answer. > > Is the "+" on the right hand side before the TODO strictly necessary? I've > seen snippets which have it and others which do not. Perhaps it is only > necessary between multiple todo keywords on the right hand side? AFAIU there=E2=80=99s no reason to distinguish between the behavior of "+" = and "-" on the left and right of "/"; they are the same. The "/" let=E2=80=99s= you avoid the more verbose TODO=3D"BLAH" form. At any rate, the "+" isn=E2=80=99t strictly necessary, while "-" is. If you have multiple items and you use "+", though, "&" can be dropped. Combining values with "+" isn=E2=80=99t useful on the RHS of "/", however, because a TODO keyword can have only one state (i.e., it can=E2=80=99t be "= TODO" and "WAITING"). > What is the significance of the "!" on the right hand side? Should it alw= ays > be present? Again, I've seen snippets with it present and others with it > absent though it is present more often than not. Would it ever appear on > the left > hand side? >From the info page I linked to above: Using =E2=80=98C-c a M=E2=80=99 or =E2=80=98/!=E2=80=99 will not match TO= DO keywords in a DONE state. Hope that helps. --=20 Kyle