emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Using org-agenda-filter-preset with or'd tags
@ 2010-12-20 14:12 johnt
  2011-01-09 13:58 ` David Maus
  0 siblings, 1 reply; 7+ messages in thread
From: johnt @ 2010-12-20 14:12 UTC (permalink / raw)
  To: emacs-orgmode

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.

As a side note when I print the agenda it seems to ignore the filter I set with
[/][-][tab]tag.  The printed version has the items not shown on screen.

using GNU Emacs 23.2.1 - ORG 7.4

Thank-you

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using org-agenda-filter-preset with or'd tags
  2010-12-20 14:12 Using org-agenda-filter-preset with or'd tags johnt
@ 2011-01-09 13:58 ` David Maus
  2011-01-10 18:01   ` John Tarbotton
  2011-01-11 13:20   ` Matt Lundin
  0 siblings, 2 replies; 7+ messages in thread
From: David Maus @ 2011-01-09 13:58 UTC (permalink / raw)
  To: johnt; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1754 bytes --]

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using org-agenda-filter-preset with or'd tags
  2011-01-09 13:58 ` David Maus
@ 2011-01-10 18:01   ` John Tarbotton
  2011-01-11 13:20   ` Matt Lundin
  1 sibling, 0 replies; 7+ messages in thread
From: John Tarbotton @ 2011-01-10 18:01 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2588 bytes --]

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
> >       '( ("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

[-- Attachment #1.2: Type: text/html, Size: 3396 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using org-agenda-filter-preset with or'd tags
  2011-01-09 13:58 ` David Maus
  2011-01-10 18:01   ` John Tarbotton
@ 2011-01-11 13:20   ` Matt Lundin
  2011-01-11 13:22     ` Matt Lundin
  2011-01-11 14:01     ` Carsten Dominik
  1 sibling, 2 replies; 7+ messages in thread
From: Matt Lundin @ 2011-01-11 13:20 UTC (permalink / raw)
  To: David Maus; +Cc: johnt, emacs-orgmode

David Maus <dmaus@ictsoc.de> writes:

> At Mon, 20 Dec 2010 14:12:39 +0000 (UTC),
> johnt wrote:

>> 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.

Quoting a list works fine in my org-agenda-custom-commands settings.
In fact, there are other variables that have quoted lists as their
setting, such as org-agenda-entry-types. 

>  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.

That's the problem.

>
>  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?
>

It would make sense if org-agenda-todo-ignore-scheduled is 'all or
'past.

To use "or" logic to filter the agenda, I would recommend setting
org-agenda-skip-function.

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      '(("W" "Work Schedule" 
         ((agenda "" 
		  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":\\(@Work\\|critical\\):")))
		   (org-agenda-ndays 1)))
          (tags-todo "@Work|critical")))))
--8<---------------cut here---------------end--------------->8---

Best,
Matt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using org-agenda-filter-preset with or'd tags
  2011-01-11 13:20   ` Matt Lundin
@ 2011-01-11 13:22     ` Matt Lundin
  2011-01-11 23:01       ` John Tarbotton
  2011-01-11 14:01     ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: Matt Lundin @ 2011-01-11 13:22 UTC (permalink / raw)
  To: David Maus; +Cc: johnt, emacs-orgmode

Matt Lundin <mdl@imapmail.org> writes:

> To use "or" logic to filter the agenda, I would recommend setting
> org-agenda-skip-function.
>
> (setq org-agenda-custom-commands
>       '(("W" "Work Schedule" 
>          ((agenda "" 
> 		  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":\\(@Work\\|critical\\):")))
> 		   (org-agenda-ndays 1)))
>           (tags-todo "@Work|critical")))))
>

The above contains a typo. It should read:

(setq org-agenda-custom-commands
      '(("W" "Work Schedule" 
         ((agenda "" 
		  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":\\(@Work\\|critical\\):"))
		   (org-agenda-ndays 1)))
          (tags-todo "@Work|critical")))))

Best,
Matt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: Using org-agenda-filter-preset with or'd tags
  2011-01-11 13:20   ` Matt Lundin
  2011-01-11 13:22     ` Matt Lundin
@ 2011-01-11 14:01     ` Carsten Dominik
  1 sibling, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2011-01-11 14:01 UTC (permalink / raw)
  To: Matt Lundin; +Cc: David Maus, johnt, emacs-orgmode


On Jan 11, 2011, at 2:20 PM, Matt Lundin wrote:

> David Maus <dmaus@ictsoc.de> writes:
>
>> At Mon, 20 Dec 2010 14:12:39 +0000 (UTC),
>> johnt wrote:
>
>>> 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.
>
> Quoting a list works fine in my org-agenda-custom-commands settings.
> In fact, there are other variables that have quoted lists as their
> setting, such as org-agenda-entry-types.

Yes.  The way the variable settings are used when constructing the  
agenda views is actually causing evaluation of the values.  So the  
quote is good here.

- Carsten


>
>> 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.
>
> That's the problem.
>
>>
>> 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?
>>
>
> It would make sense if org-agenda-todo-ignore-scheduled is 'all or
> 'past.
>
> To use "or" logic to filter the agenda, I would recommend setting
> org-agenda-skip-function.
>
> --8<---------------cut here---------------start------------->8---
> (setq org-agenda-custom-commands
>      '(("W" "Work Schedule"
>         ((agenda ""
> 		  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp  
> ":\\(@Work\\|critical\\):")))
> 		   (org-agenda-ndays 1)))
>          (tags-todo "@Work|critical")))))
> --8<---------------cut here---------------end--------------->8---
>
> Best,
> Matt
>
> _______________________________________________
> 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

- Carsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Using org-agenda-filter-preset with or'd tags
  2011-01-11 13:22     ` Matt Lundin
@ 2011-01-11 23:01       ` John Tarbotton
  0 siblings, 0 replies; 7+ messages in thread
From: John Tarbotton @ 2011-01-11 23:01 UTC (permalink / raw)
  To: Matt Lundin; +Cc: David Maus, emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1053 bytes --]

On Tue, Jan 11, 2011 at 08:22, Matt Lundin <mdl@imapmail.org> wrote:

> Matt Lundin <mdl@imapmail.org> writes:
>
> > To use "or" logic to filter the agenda, I would recommend setting
> > org-agenda-skip-function.
> >
> > (setq org-agenda-custom-commands
> >       '(("W" "Work Schedule"
> >          ((agenda ""
> >                 ((org-agenda-skip-function '(org-agenda-skip-entry-if
> 'notregexp ":\\(@Work\\|critical\\):")))
> >                  (org-agenda-ndays 1)))
> >           (tags-todo "@Work|critical")))))
> >
>
> The above contains a typo. It should read:
>
> (setq org-agenda-custom-commands
>      '(("W" "Work Schedule"
>         ((agenda ""
>                  ((org-agenda-skip-function '(org-agenda-skip-entry-if
> 'notregexp ":\\(@Work\\|critical\\):"))
>                   (org-agenda-ndays 1)))
>          (tags-todo "@Work|critical")))))
>
> Best,
> Matt
>

Thanks for the suggestion.  It did not completely work for me because the
@Work tag was inherited. However I think I can change my process a little to
make it work.

John

[-- Attachment #1.2: Type: text/html, Size: 1689 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-11 23:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-20 14:12 Using org-agenda-filter-preset with or'd tags johnt
2011-01-09 13:58 ` David Maus
2011-01-10 18:01   ` John Tarbotton
2011-01-11 13:20   ` Matt Lundin
2011-01-11 13:22     ` Matt Lundin
2011-01-11 23:01       ` John Tarbotton
2011-01-11 14:01     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).