From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Tarbotton Subject: Re: Using org-agenda-filter-preset with or'd tags Date: Mon, 10 Jan 2011 13:01:41 -0500 Message-ID: References: <87tyhikwkg.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1567099333==" Return-path: Received: from [140.186.70.92] (port=39409 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcM8W-0005QZ-IX for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 13:06:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcM3q-0007zK-G5 for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 13:05:49 -0500 Received: from mail-gw0-f41.google.com ([74.125.83.41]:34314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcM3q-0007zD-CT for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 13:01:42 -0500 Received: by gwj22 with SMTP id 22so9087478gwj.0 for ; Mon, 10 Jan 2011 10:01:41 -0800 (PST) In-Reply-To: <87tyhikwkg.wl%dmaus@ictsoc.de> 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: David Maus Cc: emacs-orgmode@gnu.org --===============1567099333== Content-Type: multipart/alternative; boundary=0016e6434a6e9a5d81049981c2f1 --0016e6434a6e9a5d81049981c2f1 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Jan 9, 2011 at 08:58, David Maus wrote: > At Mon, 20 Dec 2010 14:12:39 +0000 (UTC), > johnt wrote: > > > > I am trying to set a custom command to show my work tasks and critical > home > > tasks for the day. > > > > I have tried the following. > > > > (setq org-agenda-custom-commands > > '( ("W" "Work Schedule" > > ((agenda "" > > ((org-agenda-filter-preset '("@Work|critical")) ;; this > doesn't work > > (org-agenda-ndays 1))) > > (tags-todo "@Work|critical"))) > > ) > > > > It seems just to ignore the filter. The tags-todo line works fine. > > > > I tried various filters to verify my syntax. > > using (org-agenda-filter-preset '("+@Work")) works fine but is not what I > want. > > using (org-agenda-filter-preset '("@Work" "|" "critical")) also doesn't > work. > > There are some errors in your `org-agenda-filter-preset': > > 1. You should not quote this list, because the entire structure of > `org-agenda-custom-commands' is already quoted. > > 2. Format of `org-agenda-filter-preset' (C-h v > org-agenda-filter-preset RET): > > ,---- > | A preset of the tags filter used for secondary agenda filtering. > | This must be a list of strings, each string must be a single tag > preceded > | by "+" or "-". > `---- > > So ("@work" "|" "critical") is wrong format. > > 3. The preset filter ANDs the tags together and as far as I am aware > of (our could think of) it is not possible to OR tags together. > However, I wonder why you would like to set the preset-filter: The > tags-todo query already selects only tasks that are either tagged > @work or critical? > > HTH, > -- David > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > Thanks for the reply. It turns out that most of this did not matter. I was mostly concerned with this for export and use with Mobile Org. For these it seems to process all the custom commands together. This seems to act like a block agenda which does not support filtering of individual blocks. I could get one custom command to export or push to mobile org correctly but with more then one the filters were ignored. I ended up having to write some custom functions to process the commands one at a time to temporary files and then combine the files. The or'ing of tags not being supported is still an issue but I changed my usage to get around that. Thanks for the tip on "C-h v org-agenda-filter-preset RET" to get information on a variable. There is just so much to learn. John --0016e6434a6e9a5d81049981c2f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Sun, Jan 9, 2011 at 08:58, David Maus <dmaus@ictsoc.de> wrote:
At Mon, 20 Dec 2010 14:12:39 +0000 (UTC),
johnt wrote:
>
> I am trying to set a custom command to show my work tasks and critical= home
> tasks for the day.
>
> I have tried the following.
>
> (setq org-agenda-custom-commands
> =A0 =A0 =A0 '( ("W" "Work Schedule"
> =A0 =A0 =A0 =A0 =A0((agenda ""
> =A0 =A0 =A0 =A0 =A0 =A0((org-agenda-filter-preset '("@Work|cr= itical")) =A0 ;; this doesn't work
> =A0 =A0 =A0 =A0 =A0 =A0 (org-agenda-ndays 1)))
> =A0 =A0 =A0 =A0 =A0 (tags-todo "@Work|critical")))
> )
>
> It seems just to ignore the filter. The tags-todo line works fine.
>
> I tried various filters to verify my syntax.
> using (org-agenda-filter-preset '("+@Work")) works fine = but is not what I want.
> using (org-agenda-filter-preset '("@Work" "|" = "critical")) also doesn't work.

There are some errors in your `org-agenda-filter-preset':

=A01. You should not quote this list, because the entire structure of
=A0 =A0`org-agenda-custom-commands' is already quoted.

=A02. Format of `org-agenda-filter-preset' (C-h v
=A0 =A0org-agenda-filter-preset RET):

=A0 ,----
=A0 | A preset of the tags filter used for secondary agenda filtering.
=A0 | This must be a list of strings, each string must be a single tag pre= ceded
=A0 | by "+" or "-".
=A0 `----

=A0 So ("@work" "|" "critical") is wrong for= mat.

=A03. The preset filter ANDs the tags together and as far as I am aware
=A0 =A0of (our could think of) it is not possible to OR tags together.
=A0 =A0However, I wonder why you would like to set the preset-filter: The<= br> =A0 =A0tags-todo query already selects only tasks that are either tagged =A0 =A0@work or critical?

HTH,
=A0-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

Thanks for the reply.=A0 It turns out that mo= st of this did not matter.=A0 I was mostly
concerned with this for expo= rt and use with Mobile Org.=A0 For these it seems to
process all the cu= stom commands together.=A0 This seems to act like a block agenda
which does not support filtering of individual blocks.=A0 I could get one c= ustom command
to export or push to mobile org correctly but with more th= en one the filters were ignored.
I ended up having to write some custom = functions to process the commands one at
a time to temporary files and then combine the files. The or'ing of tag= s not being
supported is still an issue but I changed my usage to get a= round that.

Thanks for the tip on "C-h v org-agenda-filter-pres= et RET" to get information on a variable.
There is just so much to learn.

John
--0016e6434a6e9a5d81049981c2f1-- --===============1567099333== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1567099333==--