From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: Filtering agenda by tags. Date: Wed, 20 Apr 2011 08:52:32 -0400 Message-ID: <87bp01axv3.fsf@fastmail.fm> References: <4DAEB2CE.2040708@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCWtY-0003xU-3D for emacs-orgmode@gnu.org; Wed, 20 Apr 2011 08:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCWtW-0007xM-Si for emacs-orgmode@gnu.org; Wed, 20 Apr 2011 08:52:35 -0400 Received: from out4.smtp.messagingengine.com ([66.111.4.28]:53205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCWtW-0007wr-QQ for emacs-orgmode@gnu.org; Wed, 20 Apr 2011 08:52:34 -0400 In-Reply-To: <4DAEB2CE.2040708@gmail.com> (=?utf-8?Q?=22Rados=C5=82aw?= Grzanka"'s message of "Wed, 20 Apr 2011 12:17:50 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: radoslawg@gmail.com Cc: Org-mode ml Rados=C5=82aw Grzanka writes: > Hello, > I have another problem which I fail on resolving. > > Let's say I have a org file > > -------------- > #+FILETAGS: work > > * Do something at work > * Do something at the internet :internet: > -------------- > > and another file: > > -------------- > > * Do something at home :home: > * Do something at the internet :internet: > * Some other untagged task > > -------------- > > I'd like to have two agenda views: > > 1. should show things I can do at work and internet and untagged tasks > 2. should show things I can do at home and internet and untagged tasks > (setq org-agenda-custom-commands '(("x" "Work and internet and untagged" tags "+work|+internet|-TAGS= =3D{.}") ("X" "Home and internet and untagged" tags "+home|+interent|-TAGS=3D{.}"))) I am assuming that when you say "untagged", you mean items without local tags. If you want inherited tags to be considered, use ALLTAGS instead. > I fail with defining custom agenda views. I've browsed google and > already tried: > - org-agenda-filter-preset - but that seems not to support "or" (maybe > I'm missing something?) > - org-agenda-skip-function - which I found googling around - with > regexp like '(org-agenda-skip-subtree-if 'regexp ":work:")' - but that > seems not to support "inherited" tags. The simplest solution is just to use a query/match (as above). The variables org-agenda-filter-preset and org-agenda-skip-function are meant primarily for agenda views, which are built around timestamps rather than tags searches. When simply searching for tags, the tags matcher is the best bet. Note, you could accomplish the same thing with: C-c a m "work|internet|-TAGS=3D{.}" See the following for more information: - (info "(org) Tag searches") - (info "(org) Matching tags and properties") - http://orgmode.org/worg/org-tutorials/advanced-searching.html#tag-searches - http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html Best, Matt