* Filter weekly/daily agenda by tag
@ 2012-10-28 11:58 Alexander Baier
2012-10-28 12:53 ` Bastien
2012-10-28 12:57 ` Simon Thum
0 siblings, 2 replies; 6+ messages in thread
From: Alexander Baier @ 2012-10-28 11:58 UTC (permalink / raw)
To: emacs-orgmode
Hello,
this is my first post on the mailing list and i am not quite sure if i
do everything right. If i screw something up, please let me know, so i
can fix it and do it right next time.
To the problem I'm facing:
My setup: I have a single org file with appointments as sub trees.
Each appointment has an active timestamp assigned to it, so it appears
in the weekly agenda view. It also has one or more tags assigned to
it.
The agenda view i want to create: I would like to have a weekly agenda
view filtered by the tags assigned to the events.
Now, i searched the org-mode list archives and found this post:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00812.html
where Bernt Hansen writes "You should be able to achieve this by
setting the variable
org-agenda-filter.". Where does this variable org-agenda-filter come
from? If i want to describe it in emacs, i cannot find it. So i think
this is a setting which can be passed to commands in
org-agenda-custom-commands. (btw: is there a place where all the
settings i can pass to these commands is documented?) I created my own
agenda-command in my .emacs, but it did not filter the weekly agenda
view as described above. This is my code:
(setq org-agenda-custom-commands
'(("d" "Test Tag Filter"
((agenda ""
((org-agenda-files '("~/org/WeeklyFilterTest.org"))
(org-agenda-filter "-EXCL")))))))
And this is my ~/org/WeeklyFilterTest.org:
* Events
:PROPERTIES:
:CATEGORY: Event
:END:
** Event1 :INCL:
<2012-10-29 Mon>
** Event2 :INCL:
<2012-10-30 Tue>
** Event3 :EXCL:
<2012-10-30 Tue 18:00>
** Event4 :INCL:
<2012-10-30 Tue 19:00>
To explain what i want to achieve regarding this example: I want a
weekly agenda view only displaying Event1, Event2 and Event4 but not
Event3 as it should be excluded by its tag.
Any help is appreciated.
Regards
Alexander
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Filter weekly/daily agenda by tag
2012-10-28 11:58 Filter weekly/daily agenda by tag Alexander Baier
@ 2012-10-28 12:53 ` Bastien
2012-10-28 15:28 ` Alexander Baier
2012-10-28 12:57 ` Simon Thum
1 sibling, 1 reply; 6+ messages in thread
From: Bastien @ 2012-10-28 12:53 UTC (permalink / raw)
To: Alexander Baier; +Cc: emacs-orgmode
Hi Alexander,
Alexander Baier <lexi.baier@gmail.com> writes:
> (setq org-agenda-custom-commands
> '(("d" "Test Tag Filter"
> ((agenda ""
> ((org-agenda-files '("~/org/WeeklyFilterTest.org"))
> (org-agenda-filter "-EXCL")))))))
You need to locally bind `org-agenda-tag-filter-preset' to a list of
tags like '("-EXCL").
I did not test, but this should be okay:
(setq org-agenda-custom-commands
'(("d" "Test Tag Filter"
((agenda ""
((org-agenda-files '("~/org/WeeklyFilterTest.org"))
(org-agenda-tag-filter-preset '("-EXCL"))))))))
PS: You're right that org-agenda-filter does not exist.
--
Bastien
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Filter weekly/daily agenda by tag
2012-10-28 12:53 ` Bastien
@ 2012-10-28 15:28 ` Alexander Baier
2012-10-29 5:40 ` Bastien
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Baier @ 2012-10-28 15:28 UTC (permalink / raw)
To: Bastien; +Cc: emacs-orgmode
2012/10/28 Bastien <bzg@altern.org>:
> Hi Alexander,
>
> Alexander Baier <lexi.baier@gmail.com> writes:
>
>> (setq org-agenda-custom-commands
>> '(("d" "Test Tag Filter"
>> ((agenda ""
>> ((org-agenda-files '("~/org/WeeklyFilterTest.org"))
>> (org-agenda-filter "-EXCL")))))))
>
> You need to locally bind `org-agenda-tag-filter-preset' to a list of
> tags like '("-EXCL").
>
> I did not test, but this should be okay:
>
> (setq org-agenda-custom-commands
> '(("d" "Test Tag Filter"
> ((agenda ""
> ((org-agenda-files '("~/org/WeeklyFilterTest.org"))
> (org-agenda-tag-filter-preset '("-EXCL"))))))))
>
> PS: You're right that org-agenda-filter does not exist.
>
> --
> Bastien
This works as wanted it to, thank you!
Another question: Do you know if there is any documentation on the
settings i can pass to the commands in org-agenda-custom-commands?
Regards
Alexander
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Filter weekly/daily agenda by tag
2012-10-28 11:58 Filter weekly/daily agenda by tag Alexander Baier
2012-10-28 12:53 ` Bastien
@ 2012-10-28 12:57 ` Simon Thum
2012-10-28 15:40 ` Alexander Baier
1 sibling, 1 reply; 6+ messages in thread
From: Simon Thum @ 2012-10-28 12:57 UTC (permalink / raw)
To: Alexander Baier; +Cc: emacs-orgmode
On 10/28/2012 12:58 PM, Alexander Baier wrote:
> To explain what i want to achieve regarding this example: I want a
> weekly agenda view only displaying Event1, Event2 and Event4 but not
> Event3 as it should be excluded by its tag.
>
> Any help is appreciated.
FWIW, my agenda is constructed like this:
("w" "work week agenda" agenda ""
((org-agenda-span 'week)
(org-agenda-start-on-weekday 1) ;; work - begin on monday
(org-agenda-tag-filter-preset '("+@work")) ;; no OR (phd | @work)
possible here!
(org-agenda-hide-tags-regexp "@work")
(org-agenda-compact-blocks t)
))
Using the tag-filter-preset allows to change the tags inside the agenda
view because it filters the view, not the construction of the agenda.
Excluding might work like this:
(org-agenda-tag-filter-preset '("+like" "-dislike"))
but I haven't tested this combination.
I'm also hiding the @work tag as the other tags (if any) are more
relevant then.
HTH,
Simon
>
> Regards
> Alexander
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Filter weekly/daily agenda by tag
2012-10-28 12:57 ` Simon Thum
@ 2012-10-28 15:40 ` Alexander Baier
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Baier @ 2012-10-28 15:40 UTC (permalink / raw)
To: Simon Thum; +Cc: emacs-orgmode
2012/10/28 Simon Thum <simon.thum@gmx.de>:
> On 10/28/2012 12:58 PM, Alexander Baier wrote:
>>
>> To explain what i want to achieve regarding this example: I want a
>> weekly agenda view only displaying Event1, Event2 and Event4 but not
>> Event3 as it should be excluded by its tag.
>>
>> Any help is appreciated.
>
> FWIW, my agenda is constructed like this:
>
> ("w" "work week agenda" agenda ""
> ((org-agenda-span 'week)
> (org-agenda-start-on-weekday 1) ;; work - begin on monday
> (org-agenda-tag-filter-preset '("+@work")) ;; no OR (phd | @work)
> possible here!
> (org-agenda-hide-tags-regexp "@work")
> (org-agenda-compact-blocks t)
> ))
Do you know if there is another filter/setting that allows for more
complex filtering? (like the OR expression you pointed out)
>
> Using the tag-filter-preset allows to change the tags inside the agenda view
> because it filters the view, not the construction of the agenda.
>
> Excluding might work like this:
>
> (org-agenda-tag-filter-preset '("+like" "-dislike"))
This works like i wanted, thanks!
Regards
Alexander
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-29 6:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-28 11:58 Filter weekly/daily agenda by tag Alexander Baier
2012-10-28 12:53 ` Bastien
2012-10-28 15:28 ` Alexander Baier
2012-10-29 5:40 ` Bastien
2012-10-28 12:57 ` Simon Thum
2012-10-28 15:40 ` Alexander Baier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.