From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: How to do Properties search by define an agenda command Date: Thu, 11 Nov 2010 20:39:38 -0500 Message-ID: <87aalfz5et.fsf@fastmail.fm> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=45460 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGicA-0000Ow-95 for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 20:39:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGic8-0004Ey-SZ for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 20:39:42 -0500 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:56426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGic8-0004Et-PG for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 20:39:40 -0500 In-Reply-To: (Chao LU's message of "Wed, 10 Nov 2010 02:59:58 -0500") 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: Chao LU Cc: emacs-orgmode@gnu.org Chao LU writes: > Dear all, > > I'm trying to figure out how=C2=A0 to do Properties search by define an > agenda command. > > Here is my item in org file: > > *** Franz Schwabl / Quantum Mechanics > =C2=A0=C2=A0=C2=A0 :PROPERTIES: > =C2=A0=C2=A0=C2=A0 :TITLE: Quantum Mechanics > =C2=A0=C2=A0=C2=A0 :AUTHOR: Franz Schwabl > =C2=A0=C2=A0=C2=A0 :CATEGORY: Quantum Mechanics > =C2=A0=C2=A0=C2=A0 :TAGS: Quantum Mechanics, Group Theory > =C2=A0=C2=A0=C2=A0 :KEYWORD: Quantum Mechanics, Perturbation, Second Quan= tization > =C2=A0=C2=A0=C2=A0 :LOCATION: iTune > =C2=A0=C2=A0=C2=A0 :END: > > And I want to define a agenda command to search this item out. I've > tried this one, but did not work: > =C2=A0=C2=A0=C2=A0=C2=A0 ("19" "TEST" occur-tree "Title=3D"Quantum Mechan= ics"") > =C2=A0=C2=A0=C2=A0=C2=A0 ("19" "TEST" tags "Title=3D"Quantum Mechanics"") > > So is there anyone knows how to do this correctly? Two things:=20 1. You need to escape the inner quote marks in the custom command. 2. AFAICT Properties are case sensitive. Your drawer includes a "TITLE" property but your custom command searches for "Title". This custom command worked for me: (setq org-agenda-custom-commands=20 '(("x" "TEST" tags "TITLE=3D\"Quantum Mechanics\""))) You could also just type the following: C-a m TITLE=3D"Quantum Mechanics" Note: you can also use regexps in property searches. E.g., C-a m TITLE=3D{quantum.*mechanics} Best, Matt