emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* skip entry with inherited tags
@ 2010-05-18  7:42 Matthias Teege
  2010-05-18 11:18 ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Matthias Teege @ 2010-05-18  7:42 UTC (permalink / raw)
  To: emacs-orgmode

Moin,

I'm using a simple skip-function to exclude todos from a list.

(defun my-skip-someday-and-scheduled ()
  ""
     (org-agenda-skip-entry-if 'scheduled 'regexp ":SOMEDAY:"))

That works when the tag was assigned to an entry but not when it was
inherited from a parent. How do I get all tags for an entry?

Many thanks
Matthias

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

* Re: skip entry with inherited tags
  2010-05-18  7:42 skip entry with inherited tags Matthias Teege
@ 2010-05-18 11:18 ` Martin Pohlack
  2010-05-18 17:25   ` Matt Lundin
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-05-18 11:18 UTC (permalink / raw)
  To: Matthias Teege, emacs-orgmode

Hi,

On 18.05.2010 09:42, Matthias Teege wrote:
> Moin,
>
> I'm using a simple skip-function to exclude todos from a list.
>
> (defun my-skip-someday-and-scheduled ()
>    ""
>       (org-agenda-skip-entry-if 'scheduled 'regexp ":SOMEDAY:"))
>
> That works when the tag was assigned to an entry but not when it was
> inherited from a parent. How do I get all tags for an entry?

I have been using the same approach with the same limitations.  I 
stumbled upon the "tags filter preset", which supposedly should filter 
out headlines with a specific tag set.

I tried to set it to "-maybe" but it did not seem to have an effect with 
the default "Agenda" type.  Is this supposed to work?


Maybe this can help in your case:

For custom "Tags search" agenda entries I directly inline all relevant 
tag queries like so:

TODO="INBOX"-maybe|TODO="WAIT"-maybe+SCHEDULED<="<today>"|TODO="TICK"-maybe+SCHEDULED<="<today>"

Cheers,
Martin

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

* Re: skip entry with inherited tags
  2010-05-18 11:18 ` Martin Pohlack
@ 2010-05-18 17:25   ` Matt Lundin
  2010-06-03 21:44     ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Matt Lundin @ 2010-05-18 17:25 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: emacs-orgmode

Martin Pohlack <mp26@os.inf.tu-dresden.de> writes:

> Hi,
>
> On 18.05.2010 09:42, Matthias Teege wrote:
>> Moin,
>>
>> I'm using a simple skip-function to exclude todos from a list.
>>
>> (defun my-skip-someday-and-scheduled ()
>>    ""
>>       (org-agenda-skip-entry-if 'scheduled 'regexp ":SOMEDAY:"))
>>
>> That works when the tag was assigned to an entry but not when it was
>> inherited from a parent. How do I get all tags for an entry?
>
> I have been using the same approach with the same limitations.  I
> stumbled upon the "tags filter preset", which supposedly should filter
> out headlines with a specific tag set.
>
> I tried to set it to "-maybe" but it did not seem to have an effect
> with the default "Agenda" type.  Is this supposed to work?

Did you set the variable as a list? 

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      '(("x" "No maybe" todo ""
	 ((org-agenda-filter-preset '("-maybe"))))))
--8<---------------cut here---------------end--------------->8---

BTW, I believe one solution to the original question is:

--8<---------------cut here---------------start------------->8---
(setq org-agenda-custom-commands
      '(("x" "No scheduled or someday" todo ""
	 ((org-agenda-todo-ignore-scheduled t)
	  (org-agenda-filter-preset '("-SOMEDAY"))))))
--8<---------------cut here---------------end--------------->8---

Best,
Matt

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

* Re: skip entry with inherited tags
  2010-05-18 17:25   ` Matt Lundin
@ 2010-06-03 21:44     ` Martin Pohlack
  2010-06-04 11:27       ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-06-03 21:44 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

Hi All,

I finally found some hours to walk through the code.

On 18.05.2010 19:25, Matt Lundin wrote:
> Martin Pohlack <mp26@os.inf.tu-dresden.de> writes:
> 
>> Hi,
>>
>> On 18.05.2010 09:42, Matthias Teege wrote:
>>> Moin,
>>>
>>> I'm using a simple skip-function to exclude todos from a list.
>>>
>>> (defun my-skip-someday-and-scheduled ()
>>>    ""
>>>       (org-agenda-skip-entry-if 'scheduled 'regexp ":SOMEDAY:"))
>>>
>>> That works when the tag was assigned to an entry but not when it was
>>> inherited from a parent. How do I get all tags for an entry?
>>
>> I have been using the same approach with the same limitations.  I
>> stumbled upon the "tags filter preset", which supposedly should filter
>> out headlines with a specific tag set.
>>
>> I tried to set it to "-maybe" but it did not seem to have an effect
>> with the default "Agenda" type.  Is this supposed to work?
> 
> Did you set the variable as a list? 
> 
> --8<---------------cut here---------------start------------->8---
> (setq org-agenda-custom-commands
>       '(("x" "No maybe" todo ""
> 	 ((org-agenda-filter-preset '("-maybe"))))))
> --8<---------------cut here---------------end--------------->8---
> 
> BTW, I believe one solution to the original question is:
> 
> --8<---------------cut here---------------start------------->8---
> (setq org-agenda-custom-commands
>       '(("x" "No scheduled or someday" todo ""
> 	 ((org-agenda-todo-ignore-scheduled t)
> 	  (org-agenda-filter-preset '("-SOMEDAY"))))))
> --8<---------------cut here---------------end--------------->8---

Thanks for your suggestion Matt.

I now think the problem is that I have a multi-agenda.

org-finalize-agenda is called for each subagenda here but the branch
where org-agenda-filter-apply would be called is never taken as it is
scoped with "unless org-agenda-multi".  I have also found no other
non-interactive trigger for org-agenda-filter-apply.

I see two possible solutions here:
* Run org-agenda-filter-apply on a narrowed agenda buffer (only for
  the sub-agenda).  In fact, the agenda buffer seems to be narrowed
  down at this point already.  This would be the perfect solution as
  each sub-agenda could install its own org-agenda-filter-preset.

  Find attached a patch which achieves this.  It seems to work well for
  my short tests.

* Run org-agenda-filter-apply once for the whole buffer with a global
  org-agenda-filter-preset.  This would be mostly ok for some use cases
  (I only want to globally remove all "maybe" entries, including the
  inherited ones).

Cheers,
Martin

[-- Attachment #2: org-agenda-filter-apply_multi.diff --]
[-- Type: text/plain, Size: 542 bytes --]

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 19ea87c..033c981 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2760,7 +2760,9 @@ bind it in the options section.")
 
 (defun org-finalize-agenda ()
   "Finishing touch for the agenda buffer, called just before displaying it."
-  (unless org-agenda-multi
+  (if org-agenda-multi
+      (when (get 'org-agenda-filter :preset-filter)
+        (org-agenda-filter-apply org-agenda-filter))
     (save-excursion
       (let ((inhibit-read-only t))
 	(goto-char (point-min))

[-- Attachment #3: 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 related	[flat|nested] 17+ messages in thread

* Re: Re: skip entry with inherited tags
  2010-06-03 21:44     ` Martin Pohlack
@ 2010-06-04 11:27       ` Carsten Dominik
  2010-06-04 12:11         ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-06-04 11:27 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode

Hi Martin,

maybe you can summarize this discussion so that I can see when should  
be done?  Thanks.

- Carsten

On Jun 3, 2010, at 11:44 PM, Martin Pohlack wrote:

> Hi All,
>
> I finally found some hours to walk through the code.
>
> On 18.05.2010 19:25, Matt Lundin wrote:
>> Martin Pohlack <mp26@os.inf.tu-dresden.de> writes:
>>
>>> Hi,
>>>
>>> On 18.05.2010 09:42, Matthias Teege wrote:
>>>> Moin,
>>>>
>>>> I'm using a simple skip-function to exclude todos from a list.
>>>>
>>>> (defun my-skip-someday-and-scheduled ()
>>>>   ""
>>>>      (org-agenda-skip-entry-if 'scheduled 'regexp ":SOMEDAY:"))
>>>>
>>>> That works when the tag was assigned to an entry but not when it  
>>>> was
>>>> inherited from a parent. How do I get all tags for an entry?
>>>
>>> I have been using the same approach with the same limitations.  I
>>> stumbled upon the "tags filter preset", which supposedly should  
>>> filter
>>> out headlines with a specific tag set.
>>>
>>> I tried to set it to "-maybe" but it did not seem to have an effect
>>> with the default "Agenda" type.  Is this supposed to work?
>>
>> Did you set the variable as a list?
>>
>> --8<---------------cut here---------------start------------->8---
>> (setq org-agenda-custom-commands
>>      '(("x" "No maybe" todo ""
>> 	 ((org-agenda-filter-preset '("-maybe"))))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> BTW, I believe one solution to the original question is:
>>
>> --8<---------------cut here---------------start------------->8---
>> (setq org-agenda-custom-commands
>>      '(("x" "No scheduled or someday" todo ""
>> 	 ((org-agenda-todo-ignore-scheduled t)
>> 	  (org-agenda-filter-preset '("-SOMEDAY"))))))
>> --8<---------------cut here---------------end--------------->8---
>
> Thanks for your suggestion Matt.
>
> I now think the problem is that I have a multi-agenda.
>
> org-finalize-agenda is called for each subagenda here but the branch
> where org-agenda-filter-apply would be called is never taken as it is
> scoped with "unless org-agenda-multi".  I have also found no other
> non-interactive trigger for org-agenda-filter-apply.
>
> I see two possible solutions here:
> * Run org-agenda-filter-apply on a narrowed agenda buffer (only for
>  the sub-agenda).  In fact, the agenda buffer seems to be narrowed
>  down at this point already.  This would be the perfect solution as
>  each sub-agenda could install its own org-agenda-filter-preset.
>
>  Find attached a patch which achieves this.  It seems to work well for
>  my short tests.
>
> * Run org-agenda-filter-apply once for the whole buffer with a global
>  org-agenda-filter-preset.  This would be mostly ok for some use cases
>  (I only want to globally remove all "maybe" entries, including the
>  inherited ones).
>
> Cheers,
> Martin
> <org-agenda-filter- 
> apply_multi.diff>_______________________________________________
> 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] 17+ messages in thread

* Re: Re: skip entry with inherited tags
  2010-06-04 11:27       ` Carsten Dominik
@ 2010-06-04 12:11         ` Martin Pohlack
  2010-07-07  8:49           ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-06-04 12:11 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

On 04.06.2010 13:27, Carsten Dominik wrote:
> Hi Martin,
>
> maybe you can summarize this discussion so that I can see when should
> be done?  Thanks.

* org-agenda-filter-preset is ignored for multi-part agendas (broken)
* I have a patch that fixes this by applying filtering for each sub-part
* The patch works for me

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-06-04 12:11         ` Martin Pohlack
@ 2010-07-07  8:49           ` Martin Pohlack
  2010-07-13 11:49             ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-07-07  8:49 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Hi Carsten,

On 04.06.2010 14:11, Martin Pohlack wrote:
> On 04.06.2010 13:27, Carsten Dominik wrote:
>> Hi Martin,
>>
>> maybe you can summarize this discussion so that I can see when should
>> be done?  Thanks.
>
> * org-agenda-filter-preset is ignored for multi-part agendas (broken)
> * I have a patch that fixes this by applying filtering for each sub-part
> * The patch works for me

May I inquire the state of this item?

The patch seems to have vanished from the default view in patchwork it 
is only shown here:

http://patchwork.newartisans.com/project/org-mode/list/?archive=both

But it is still "Under Review" by you.

Do you need assistance with the patch?

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-07-07  8:49           ` Martin Pohlack
@ 2010-07-13 11:49             ` Carsten Dominik
  2010-07-13 17:41               ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-07-13 11:49 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode

Hi Martin,

On Jul 7, 2010, at 10:49 AM, Martin Pohlack wrote:

> Hi Carsten,
>
> On 04.06.2010 14:11, Martin Pohlack wrote:
>> On 04.06.2010 13:27, Carsten Dominik wrote:
>>> Hi Martin,
>>>
>>> maybe you can summarize this discussion so that I can see when  
>>> should
>>> be done?  Thanks.
>>
>> * org-agenda-filter-preset is ignored for multi-part agendas (broken)
>> * I have a patch that fixes this by applying filtering for each sub- 
>> part
>> * The patch works for me
>
> May I inquire the state of this item?
>
> The patch seems to have vanished from the default view in patchwork  
> it is only shown here:
>
> http://patchwork.newartisans.com/project/org-mode/list/?archive=both
>
> But it is still "Under Review" by you.
>
> Do you need assistance with the patch?

Sorry for taking so much time for this.
I am still holding the patch because I have an almost unconscious itch
that something is wrong with it.  I cannot say what exactly it is
(if anything).  The logic of what needs to be done when in
block agendas has some reason.  One of the things I can say already
it that with such a local filter, I am afraid that updating the
agenda, or modifying the filter might fail or lead to strange results.
This is actually something you might want to work on testing.

I will only be able to study this more closely after the release.

Sorry

- Carsten
>
> Cheers,
> Martin

- Carsten

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

* Re: Re: skip entry with inherited tags
  2010-07-13 11:49             ` Carsten Dominik
@ 2010-07-13 17:41               ` Martin Pohlack
  2010-07-13 18:48                 ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-07-13 17:41 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Hi Carsten,

On 13.07.2010 13:49, Carsten Dominik wrote:
> Sorry for taking so much time for this.
> I am still holding the patch because I have an almost unconscious itch
> that something is wrong with it.  I cannot say what exactly it is
> (if anything).  The logic of what needs to be done when in
> block agendas has some reason.  One of the things I can say already
> it that with such a local filter, I am afraid that updating the
> agenda, or modifying the filter might fail or lead to strange results.
> This is actually something you might want to work on testing.

Hard to respond to this vague situation :-).

It would be great if you could point me at more specific situations that
might break or if others could test the patch.  I have been using it for
more than a month now without problems.

> I will only be able to study this more closely after the release.

Take your time, I will wait for more details to emerge or feedback from
other testers.

One more note here: The current situation for block agendas is a bit
problematic as their limitations are not documented afaik.

Writing custom agendas is not easy in itself.  If things don't work, it
is really hard to distinguish between driver errors and limitations of
the block agendas.

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-07-13 17:41               ` Martin Pohlack
@ 2010-07-13 18:48                 ` Carsten Dominik
  2010-07-13 20:34                   ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-07-13 18:48 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode


On Jul 13, 2010, at 7:41 PM, Martin Pohlack wrote:

> Hi Carsten,
>
> On 13.07.2010 13:49, Carsten Dominik wrote:
>> Sorry for taking so much time for this.
>> I am still holding the patch because I have an almost unconscious  
>> itch
>> that something is wrong with it.  I cannot say what exactly it is
>> (if anything).  The logic of what needs to be done when in
>> block agendas has some reason.  One of the things I can say already
>> it that with such a local filter, I am afraid that updating the
>> agenda, or modifying the filter might fail or lead to strange  
>> results.
>> This is actually something you might want to work on testing.
>
> Hard to respond to this vague situation :-).
>
> It would be great if you could point me at more specific situations  
> that
> might break or if others could test the patch.  I have been using it  
> for
> more than a month now without problems.

The specific one I meant is if you use r or g to rebuild the agenda,
if you do something like a refile command which does an automatic  
rebuild,
do you get back the view you expected?

Also, if you apply other filter commands, either with "/", or narrowing
the filter with "/", does that give the expected results while you are
in your block agenda?

>
>> I will only be able to study this more closely after the release.
>
> Take your time, I will wait for more details to emerge or feedback  
> from
> other testers.
>
> One more note here: The current situation for block agendas is a bit
> problematic as their limitations are not documented afaik.
>
> Writing custom agendas is not easy in itself.  If things don't work,  
> it
> is really hard to distinguish between driver errors and limitations of
> the block agendas.

Do you have suggestions on how to improve the situation?

- Carsten

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

* Re: Re: skip entry with inherited tags
  2010-07-13 18:48                 ` Carsten Dominik
@ 2010-07-13 20:34                   ` Martin Pohlack
  2010-07-21 14:32                     ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-07-13 20:34 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Hi Carsten and Matt,

On 13.07.2010 20:48, Carsten Dominik wrote:
> On Jul 13, 2010, at 7:41 PM, Martin Pohlack wrote:
>> Hard to respond to this vague situation :-).
>>
>> It would be great if you could point me at more specific situations  
>> that
>> might break or if others could test the patch.  I have been using it  
>> for
>> more than a month now without problems.
> 
> The specific one I meant is if you use r or g to rebuild the agenda,
> if you do something like a refile command which does an automatic  
> rebuild,
> do you get back the view you expected?

Yes, I regularly use 'r'.  It works for me.  Refiling a single entry did
not show a problem.

> Also, if you apply other filter commands, either with "/", or narrowing
> the filter with "/", does that give the expected results while you are
> in your block agenda?

I quickly applied a tag filter using '/' 'tab'.  Only the relevant
entries were shown.  Some block agendas become empty as expected.
Clearing the filter restores the expected full view.

I am not entirely sure that the patch does not have problems though.

Matt: could you give the patch a quick test at your end?

>>> I will only be able to study this more closely after the release.
>>
>> Take your time, I will wait for more details to emerge or feedback  
>> from
>> other testers.
>>
>> One more note here: The current situation for block agendas is a bit
>> problematic as their limitations are not documented afaik.
>>
>> Writing custom agendas is not easy in itself.  If things don't work,  
>> it
>> is really hard to distinguish between driver errors and limitations of
>> the block agendas.
> 
> Do you have suggestions on how to improve the situation?

* Well, the best thing to do would be to remove the limitations of the
  block agendas, obviously :-), which I hope this patch does.

* The second best thing is to document them.

I am aware of this tag filter limitation, but no others from the top of
my head.  Do others know more?

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-07-13 20:34                   ` Martin Pohlack
@ 2010-07-21 14:32                     ` Carsten Dominik
  2010-07-22  7:38                       ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-07-21 14:32 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode

Hi Martin,

I just looked at your patch.

If I have a normal agenda (i.e. *not* a block agenda), then your
patch will cause the preset filter *not* to be applied.

- Carsten

On Jul 13, 2010, at 10:34 PM, Martin Pohlack wrote:

> Hi Carsten and Matt,
>
> On 13.07.2010 20:48, Carsten Dominik wrote:
>> On Jul 13, 2010, at 7:41 PM, Martin Pohlack wrote:
>>> Hard to respond to this vague situation :-).
>>>
>>> It would be great if you could point me at more specific situations
>>> that
>>> might break or if others could test the patch.  I have been using it
>>> for
>>> more than a month now without problems.
>>
>> The specific one I meant is if you use r or g to rebuild the agenda,
>> if you do something like a refile command which does an automatic
>> rebuild,
>> do you get back the view you expected?
>
> Yes, I regularly use 'r'.  It works for me.  Refiling a single entry  
> did
> not show a problem.
>
>> Also, if you apply other filter commands, either with "/", or  
>> narrowing
>> the filter with "/", does that give the expected results while you  
>> are
>> in your block agenda?
>
> I quickly applied a tag filter using '/' 'tab'.  Only the relevant
> entries were shown.  Some block agendas become empty as expected.
> Clearing the filter restores the expected full view.
>
> I am not entirely sure that the patch does not have problems though.
>
> Matt: could you give the patch a quick test at your end?
>
>>>> I will only be able to study this more closely after the release.
>>>
>>> Take your time, I will wait for more details to emerge or feedback
>>> from
>>> other testers.
>>>
>>> One more note here: The current situation for block agendas is a bit
>>> problematic as their limitations are not documented afaik.
>>>
>>> Writing custom agendas is not easy in itself.  If things don't work,
>>> it
>>> is really hard to distinguish between driver errors and  
>>> limitations of
>>> the block agendas.
>>
>> Do you have suggestions on how to improve the situation?
>
> * Well, the best thing to do would be to remove the limitations of the
>  block agendas, obviously :-), which I hope this patch does.
>
> * The second best thing is to document them.
>
> I am aware of this tag filter limitation, but no others from the top  
> of
> my head.  Do others know more?
>
> Cheers,
> Martin

- Carsten

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

* Re: Re: skip entry with inherited tags
  2010-07-21 14:32                     ` Carsten Dominik
@ 2010-07-22  7:38                       ` Carsten Dominik
  2010-08-04 21:38                         ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-07-22  7:38 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, Martin Pohlack, emacs-orgmode

Hi Martin,

On Jul 21, 2010, at 4:32 PM, Carsten Dominik wrote:

> Hi Martin,
>
> I just looked at your patch.
>
> If I have a normal agenda (i.e. *not* a block agenda), then your
> patch will cause the preset filter *not* to be applied.

OK, that was obviously incorrect, sorry about that.

However, it still does not work correctly, here is the counter example:

-----------------------------------------------------------------------------
* TODO test 1								  :a:
* TODO test 2								  :b:

* at 1									  :a:
   SCHEDULED: <2010-07-22 Thu>
* at 1									  :b:
   SCHEDULED: <2010-07-22 Thu>
------------------------------------------------------------------------------

With this custom command:

(setq org-agenda-custom-commands
       '(("x" "testmartin"
	 ((agenda "" ((org-agenda-filter-preset '("+a"))))
	  (alltodo "" ((org-agenda-filter-preset '("+b")))))
	 nil nil)))

the result is incorrect, both with and without your patch.

The internal logic of the filter and the preset filter is such that
it applies to the entire view, and you should not set in the local
options for a command that is part of a block agenda view.

I have now documented this limitation.

Sorry that this took so long - thank you for your patience.

Best wishes

- Carsten



>
> - Carsten
>
> On Jul 13, 2010, at 10:34 PM, Martin Pohlack wrote:
>
>> Hi Carsten and Matt,
>>
>> On 13.07.2010 20:48, Carsten Dominik wrote:
>>> On Jul 13, 2010, at 7:41 PM, Martin Pohlack wrote:
>>>> Hard to respond to this vague situation :-).
>>>>
>>>> It would be great if you could point me at more specific situations
>>>> that
>>>> might break or if others could test the patch.  I have been using  
>>>> it
>>>> for
>>>> more than a month now without problems.
>>>
>>> The specific one I meant is if you use r or g to rebuild the agenda,
>>> if you do something like a refile command which does an automatic
>>> rebuild,
>>> do you get back the view you expected?
>>
>> Yes, I regularly use 'r'.  It works for me.  Refiling a single  
>> entry did
>> not show a problem.
>>
>>> Also, if you apply other filter commands, either with "/", or  
>>> narrowing
>>> the filter with "/", does that give the expected results while you  
>>> are
>>> in your block agenda?
>>
>> I quickly applied a tag filter using '/' 'tab'.  Only the relevant
>> entries were shown.  Some block agendas become empty as expected.
>> Clearing the filter restores the expected full view.
>>
>> I am not entirely sure that the patch does not have problems though.
>>
>> Matt: could you give the patch a quick test at your end?
>>
>>>>> I will only be able to study this more closely after the release.
>>>>
>>>> Take your time, I will wait for more details to emerge or feedback
>>>> from
>>>> other testers.
>>>>
>>>> One more note here: The current situation for block agendas is a  
>>>> bit
>>>> problematic as their limitations are not documented afaik.
>>>>
>>>> Writing custom agendas is not easy in itself.  If things don't  
>>>> work,
>>>> it
>>>> is really hard to distinguish between driver errors and  
>>>> limitations of
>>>> the block agendas.
>>>
>>> Do you have suggestions on how to improve the situation?
>>
>> * Well, the best thing to do would be to remove the limitations of  
>> the
>> block agendas, obviously :-), which I hope this patch does.
>>
>> * The second best thing is to document them.
>>
>> I am aware of this tag filter limitation, but no others from the  
>> top of
>> my head.  Do others know more?
>>
>> Cheers,
>> Martin
>
> - Carsten
>
>
>

- Carsten

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

* Re: Re: skip entry with inherited tags
  2010-07-22  7:38                       ` Carsten Dominik
@ 2010-08-04 21:38                         ` Martin Pohlack
  2010-08-16 12:50                           ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-08-04 21:38 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Hi Carsten,

On 22.07.2010 09:38, Carsten Dominik wrote:
> Hi Martin,
> 
> On Jul 21, 2010, at 4:32 PM, Carsten Dominik wrote:
> 
>> Hi Martin,
>>
>> I just looked at your patch.
>>
>> If I have a normal agenda (i.e. *not* a block agenda), then your
>> patch will cause the preset filter *not* to be applied.
> 
> OK, that was obviously incorrect, sorry about that.
> 
> However, it still does not work correctly, here is the counter example:
> 
> -----------------------------------------------------------------------------
> * TODO test 1								  :a:
> * TODO test 2								  :b:
> 
> * at 1									  :a:
>    SCHEDULED: <2010-07-22 Thu>
> * at 1									  :b:
>    SCHEDULED: <2010-07-22 Thu>
> ------------------------------------------------------------------------------

Here is what I found to be incorrect.

* For unmodified org-mode, this ignores the org-agenda-filter-preset.
  Is this what you mean or is anything else broken?

* For my patched version, too much is hidden and only revealed after
  clearing the global filter.  Did you mean anything else?

> With this custom command:
> 
> (setq org-agenda-custom-commands
>        '(("x" "testmartin"
> 	 ((agenda "" ((org-agenda-filter-preset '("+a"))))
> 	  (alltodo "" ((org-agenda-filter-preset '("+b")))))
> 	 nil nil)))
> 
> the result is incorrect, both with and without your patch.

But in different ways, as state above.

> The internal logic of the filter and the preset filter is such that
> it applies to the entire view, and you should not set in the local
> options for a command that is part of a block agenda view.

Well, it is already partly there in that local filters are stored in
text properties for each line.  Maybe we can extend this a bit to remove
this limitation?

I will look into it if I have more time.

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-08-04 21:38                         ` Martin Pohlack
@ 2010-08-16 12:50                           ` Carsten Dominik
  2010-08-16 12:56                             ` Martin Pohlack
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Dominik @ 2010-08-16 12:50 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode


On Aug 4, 2010, at 11:38 PM, Martin Pohlack wrote:

> Hi Carsten,
>
> On 22.07.2010 09:38, Carsten Dominik wrote:
>> Hi Martin,
>>
>> On Jul 21, 2010, at 4:32 PM, Carsten Dominik wrote:
>>
>>> Hi Martin,
>>>
>>> I just looked at your patch.
>>>
>>> If I have a normal agenda (i.e. *not* a block agenda), then your
>>> patch will cause the preset filter *not* to be applied.
>>
>> OK, that was obviously incorrect, sorry about that.
>>
>> However, it still does not work correctly, here is the counter  
>> example:
>>
>> -----------------------------------------------------------------------------
>> * TODO test 1								  :a:
>> * TODO test 2								  :b:
>>
>> * at 1									  :a:
>>   SCHEDULED: <2010-07-22 Thu>
>> * at 1									  :b:
>>   SCHEDULED: <2010-07-22 Thu>
>> ------------------------------------------------------------------------------
>
> Here is what I found to be incorrect.
>
> * For unmodified org-mode, this ignores the org-agenda-filter-preset.
>  Is this what you mean or is anything else broken?
>
> * For my patched version, too much is hidden and only revealed after
>  clearing the global filter.  Did you mean anything else?
>
>> With this custom command:
>>
>> (setq org-agenda-custom-commands
>>       '(("x" "testmartin"
>> 	 ((agenda "" ((org-agenda-filter-preset '("+a"))))
>> 	  (alltodo "" ((org-agenda-filter-preset '("+b")))))
>> 	 nil nil)))
>>
>> the result is incorrect, both with and without your patch.
>
> But in different ways, as state above.

Yes, in different ways.

>
>> The internal logic of the filter and the preset filter is such that
>> it applies to the entire view, and you should not set in the local
>> options for a command that is part of a block agenda view.
>
> Well, it is already partly there in that local filters are stored in
> text properties for each line.  Maybe we can extend this a bit to  
> remove
> this limitation?

I think this will be tidious.  For block agendas, I guess a skip
condition will be better than filtering.

Best wishes

- Carsten

>
> I will look into it if I have more time.
>
> Cheers,
> Martin

- Carsten

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

* Re: Re: skip entry with inherited tags
  2010-08-16 12:50                           ` Carsten Dominik
@ 2010-08-16 12:56                             ` Martin Pohlack
  2010-08-16 13:10                               ` Carsten Dominik
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Pohlack @ 2010-08-16 12:56 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, emacs-orgmode

Hi Carsten,

[...]

>>> The internal logic of the filter and the preset filter is such that
>>> it applies to the entire view, and you should not set in the local
>>> options for a command that is part of a block agenda view.
>>
>> Well, it is already partly there in that local filters are stored in
>> text properties for each line.  Maybe we can extend this a bit to
>> remove
>> this limitation?
>
> I think this will be tidious.

Yes, I saw this on my first attempts to look at the code :-).  I have 
not yet given up on this though ...

> For block agendas, I guess a skip
> condition will be better than filtering.

This does not help with inherited tags, AFAIK.  For example, if I mark a 
whole tree of things with :maybe:, the inheriting items in the tree 
cannot easily be skipped.

Cheers,
Martin

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

* Re: Re: skip entry with inherited tags
  2010-08-16 12:56                             ` Martin Pohlack
@ 2010-08-16 13:10                               ` Carsten Dominik
  0 siblings, 0 replies; 17+ messages in thread
From: Carsten Dominik @ 2010-08-16 13:10 UTC (permalink / raw)
  To: Martin Pohlack; +Cc: Matt Lundin, emacs-orgmode


On Aug 16, 2010, at 2:56 PM, Martin Pohlack wrote:

> Hi Carsten,
>
> [...]
>
>>>> The internal logic of the filter and the preset filter is such that
>>>> it applies to the entire view, and you should not set in the local
>>>> options for a command that is part of a block agenda view.
>>>
>>> Well, it is already partly there in that local filters are stored in
>>> text properties for each line.  Maybe we can extend this a bit to
>>> remove
>>> this limitation?
>>
>> I think this will be tidious.
>
> Yes, I saw this on my first attempts to look at the code :-).  I  
> have not yet given up on this though ...
>
>> For block agendas, I guess a skip
>> condition will be better than filtering.
>
> This does not help with inherited tags, AFAIK.  For example, if I  
> mark a whole tree of things with :maybe:, the inheriting items in  
> the tree cannot easily be skipped.

Easily yes, cheaply no.

You can call `org-get-tags-at' to get either only
local tags or both local and inherited tags.

Also, when an item is listed in the agenda, it has a text
property mentioning all tags.  You can also write your own hook function
to run through the agenda and remove certain lines (just delete them)
based on the text properties each item has.

- Carsten

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

end of thread, other threads:[~2010-08-16 13:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18  7:42 skip entry with inherited tags Matthias Teege
2010-05-18 11:18 ` Martin Pohlack
2010-05-18 17:25   ` Matt Lundin
2010-06-03 21:44     ` Martin Pohlack
2010-06-04 11:27       ` Carsten Dominik
2010-06-04 12:11         ` Martin Pohlack
2010-07-07  8:49           ` Martin Pohlack
2010-07-13 11:49             ` Carsten Dominik
2010-07-13 17:41               ` Martin Pohlack
2010-07-13 18:48                 ` Carsten Dominik
2010-07-13 20:34                   ` Martin Pohlack
2010-07-21 14:32                     ` Carsten Dominik
2010-07-22  7:38                       ` Carsten Dominik
2010-08-04 21:38                         ` Martin Pohlack
2010-08-16 12:50                           ` Carsten Dominik
2010-08-16 12:56                             ` Martin Pohlack
2010-08-16 13:10                               ` 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).