emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: skip entry with inherited tags


From: Martin Pohlack
Subject: [Orgmode] Re: skip entry with inherited tags
Date: Thu, 03 Jun 2010 23:44:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

Hi All,

I finally found some hours to walk through the code.

On 18.05.2010 19:25, Matt Lundin wrote:
> Martin Pohlack <address@hidden> 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: org-agenda-filter-apply_multi.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]