From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Question about searches (ultimately for agenda) Date: Tue, 15 Dec 2009 22:26:22 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKkX2-000311-Gw for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 22:26:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKkWx-0002uK-3J for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 22:26:31 -0500 Received: from [199.232.76.173] (port=40332 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKkWw-0002tx-RQ for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 22:26:26 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:45616) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKkWw-0006Jl-Mn for emacs-orgmode@gnu.org; Tue, 15 Dec 2009 22:26:26 -0500 In-Reply-To: (Mueen Nawaz's message of "Tue, 15 Dec 2009 19:57:25 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mueen Nawaz Cc: emacs-orgmode@gnu.org Mueen Nawaz writes: > In the docs (10.3.3 Matching tags and properties), I see ways to do > tag searches that can also search TODO states. > > Can I also search TODO levels? For example, in one file covered by the > agenda, I use the usual DONE to denote done. In another, which is > focused on simply stuff that I have borrowed/lent, I have RETURNED as > my "DONE" state. > > I occasionally apply tags to headings with the name of the person > involved. So let's say that I've put :Jack: on some headings of items > that have been lent and returned. But I also have :Jack: in my other > .org files that are not about lending/borrowing. > > I want to search for all headlines that have :Jack: in them, but > exclude anything that is a "DONE" state - so exclude both DONE and > RETURNED. > > I know I can just do: > Jack-TODO="DONE"-TODO="RETURNED" Provided DONE and RETURNED are inactive todos than the following should suffice: C-a M Jack [RET] AFAIK, C-a M returns only active TODOs that match the tag. Thus any inactive state will be excluded. (There may be a variable that controls this, but I'm not aware of it.) Best, Matt