emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Does secondary filtering allow multiple tags?
@ 2009-01-09  1:55 Hsiu-Khuern Tang
  2009-01-09  7:38 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Hsiu-Khuern Tang @ 2009-01-09  1:55 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Hi all,

Suppose I have tagged some of my TODO headings.  In an agenda view, is it
currently possible to filter (using org-agenda-filter-by-tag) all entries that
are tagged with (say) either "project1" _or_ "project2"?  One can certainly do
"project1" _and_ "project2" by narrowing the filter.

I am trying to look at my weekly agenda, restricted to two particular projects
that are identified using tags.

I tried defining a custom agenda view with a org-agenda-skip-function defined
to match ":project1:" or ":project2:", but this doesn't work with inherited
tags.

-- 
Best,
Hsiu-Khuern.

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

* Re: Does secondary filtering allow multiple tags?
  2009-01-09  1:55 Does secondary filtering allow multiple tags? Hsiu-Khuern Tang
@ 2009-01-09  7:38 ` Carsten Dominik
  2009-01-09 19:18   ` Hsiu-Khuern Tang
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-01-09  7:38 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: emacs-orgmode@gnu.org


On Jan 9, 2009, at 2:55 AM, Hsiu-Khuern Tang wrote:

> Hi all,
>
> Suppose I have tagged some of my TODO headings.  In an agenda view,  
> is it
> currently possible to filter (using org-agenda-filter-by-tag) all  
> entries that
> are tagged with (say) either "project1" _or_ "project2"?  One can  
> certainly do
> "project1" _and_ "project2" by narrowing the filter.

No.

- Carsten

>
>
> I am trying to look at my weekly agenda, restricted to two  
> particular projects
> that are identified using tags.
>
> I tried defining a custom agenda view with a org-agenda-skip- 
> function defined
> to match ":project1:" or ":project2:", but this doesn't work with  
> inherited
> tags.
>
> -- 
> Best,
> Hsiu-Khuern.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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: Does secondary filtering allow multiple tags?
  2009-01-09  7:38 ` Carsten Dominik
@ 2009-01-09 19:18   ` Hsiu-Khuern Tang
  2009-01-09 19:32     ` Hsiu-Khuern Tang
  2009-01-10 11:12     ` Carsten Dominik
  0 siblings, 2 replies; 7+ messages in thread
From: Hsiu-Khuern Tang @ 2009-01-09 19:18 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

* On Fri 07:38AM +0000, 09 Jan 2009, Carsten Dominik (dominik@science.uva.nl) wrote:
> 
> On Jan 9, 2009, at 2:55 AM, Hsiu-Khuern Tang wrote:
> 
> > Hi all,
> >
> > Suppose I have tagged some of my TODO headings.  In an agenda view,  
> > is it
> > currently possible to filter (using org-agenda-filter-by-tag) all  
> > entries that
> > are tagged with (say) either "project1" _or_ "project2"?  One can  
> > certainly do
> > "project1" _and_ "project2" by narrowing the filter.
> 
> No.
> 
> - Carsten

Here's a workaround.  I use org-map-entries to select all headlines directly
tagged with "project1" or "project2" and tag them with something unique, say
"CUR".  Then I can use the ordinary filter mechanism in an agenda view to
restrict to headlines tagged with "CUR".

,----
| (setq cur_tags '("project1" "project2"))
| 
| ;; Unbind the variable
| ;; (makunbound 'cur_tags)
| 
| (setq match_string (concat "+TAGS={" (mapconcat (lambda (x) x)
| 						cur_tags "\|") "}"))
| 
| ;; Remove the "CUR" tag:
| (org-map-entries '(org-toggle-tag "CUR") "CUR" 'agenda)
| 
| ;; Turn on the CUR tag for all headlines (directly) tagged with
| ;; any member of cur_tags
| (org-map-entries '(org-toggle-tag "CUR" 'on) match_string 'agenda)
| 
| ;; Count the number of headlines (directly) tagged with any member of
| ;; cur_tags:
| (length (org-map-entries t match_string 'agenda))
`----

Maybe someone will find this useful, or think of a more elegant solution.

-- 
Best,
Hsiu-Khuern.

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

* Re: Does secondary filtering allow multiple tags?
  2009-01-09 19:18   ` Hsiu-Khuern Tang
@ 2009-01-09 19:32     ` Hsiu-Khuern Tang
  2009-01-10 11:12     ` Carsten Dominik
  1 sibling, 0 replies; 7+ messages in thread
From: Hsiu-Khuern Tang @ 2009-01-09 19:32 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

* On Fri 07:18PM +0000, 09 Jan 2009, Hsiu-Khuern Tang (hsiu-khuern.tang@hp.com) wrote:

> Here's a workaround.  I use org-map-entries to select all headlines directly
> tagged with "project1" or "project2" and tag them with something unique, say
> "CUR".  Then I can use the ordinary filter mechanism in an agenda view to
> restrict to headlines tagged with "CUR".
> 
> ,----
> | (setq cur_tags '("project1" "project2"))
> | 
> | ;; Unbind the variable
> | ;; (makunbound 'cur_tags)
> | 
> | (setq match_string (concat "+TAGS={" (mapconcat (lambda (x) x)
> | 						cur_tags "\|") "}"))

Correction: the above should have an extra "\":

,----
| (setq match_string (concat "+TAGS={" (mapconcat (lambda (x) x)
| 						cur_tags "\\|") "}"))
`----

> | ;; Remove the "CUR" tag:
> | (org-map-entries '(org-toggle-tag "CUR") "CUR" 'agenda)
> | 
> | ;; Turn on the CUR tag for all headlines (directly) tagged with
> | ;; any member of cur_tags
> | (org-map-entries '(org-toggle-tag "CUR" 'on) match_string 'agenda)
> | 
> | ;; Count the number of headlines (directly) tagged with any member of
> | ;; cur_tags:
> | (length (org-map-entries t match_string 'agenda))
> `----

-- 
Best,
Hsiu-Khuern.

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

* Re: Does secondary filtering allow multiple tags?
  2009-01-09 19:18   ` Hsiu-Khuern Tang
  2009-01-09 19:32     ` Hsiu-Khuern Tang
@ 2009-01-10 11:12     ` Carsten Dominik
  2009-01-12 17:37       ` Hsiu-Khuern Tang
  1 sibling, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-01-10 11:12 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: emacs-orgmode@gnu.org

Hi Hsiu,

nice hack.  But I am still wondering why you do not
use "primary filtering" for this, i.e. a tags search
for "project1|project2"

     C-c a m project1|project2 RET

- Carsten

On Jan 9, 2009, at 8:18 PM, Hsiu-Khuern Tang wrote:

> * On Fri 07:38AM +0000, 09 Jan 2009, Carsten Dominik (dominik@science.uva.nl 
> ) wrote:
>>
>> On Jan 9, 2009, at 2:55 AM, Hsiu-Khuern Tang wrote:
>>
>>> Hi all,
>>>
>>> Suppose I have tagged some of my TODO headings.  In an agenda view,
>>> is it
>>> currently possible to filter (using org-agenda-filter-by-tag) all
>>> entries that
>>> are tagged with (say) either "project1" _or_ "project2"?  One can
>>> certainly do
>>> "project1" _and_ "project2" by narrowing the filter.
>>
>> No.
>>
>> - Carsten
>
> Here's a workaround.  I use org-map-entries to select all headlines  
> directly
> tagged with "project1" or "project2" and tag them with something  
> unique, say
> "CUR".  Then I can use the ordinary filter mechanism in an agenda  
> view to
> restrict to headlines tagged with "CUR".
>
> ,----
> | (setq cur_tags '("project1" "project2"))
> |
> | ;; Unbind the variable
> | ;; (makunbound 'cur_tags)
> |
> | (setq match_string (concat "+TAGS={" (mapconcat (lambda (x) x)
> | 						cur_tags "\|") "}"))
> |
> | ;; Remove the "CUR" tag:
> | (org-map-entries '(org-toggle-tag "CUR") "CUR" 'agenda)
> |
> | ;; Turn on the CUR tag for all headlines (directly) tagged with
> | ;; any member of cur_tags
> | (org-map-entries '(org-toggle-tag "CUR" 'on) match_string 'agenda)
> |
> | ;; Count the number of headlines (directly) tagged with any member  
> of
> | ;; cur_tags:
> | (length (org-map-entries t match_string 'agenda))
> `----
>
> Maybe someone will find this useful, or think of a more elegant  
> solution.
>
> -- 
> Best,
> Hsiu-Khuern.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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: Does secondary filtering allow multiple tags?
  2009-01-10 11:12     ` Carsten Dominik
@ 2009-01-12 17:37       ` Hsiu-Khuern Tang
  2009-01-13  9:18         ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Hsiu-Khuern Tang @ 2009-01-12 17:37 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

* On Sat 11:12AM +0000, 10 Jan 2009, Carsten Dominik (dominik@science.uva.nl) wrote:
> Hi Hsiu,
> 
> nice hack.  But I am still wondering why you do not
> use "primary filtering" for this, i.e. a tags search
> for "project1|project2"
> 
>      C-c a m project1|project2 RET

I couldn't get such a search to work with a daily/weekly/monthly agenda view.
I was trying to restrict the weekly (say) agenda view to just two projects
(identified by tags), which seems like a nice view for scheduling tasks.  I
would love a simple way to do this.  If different projects were in different
files, then one can modify org-agenda-files temporarily to achieve this, but my
projects are not always cleanly separated that way.

-- 
Best,
Hsiu-Khuern.

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

* Re: Does secondary filtering allow multiple tags?
  2009-01-12 17:37       ` Hsiu-Khuern Tang
@ 2009-01-13  9:18         ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-01-13  9:18 UTC (permalink / raw)
  To: Hsiu-Khuern Tang; +Cc: emacs-orgmode@gnu.org


On Jan 12, 2009, at 6:37 PM, Hsiu-Khuern Tang wrote:

> * On Sat 11:12AM +0000, 10 Jan 2009, Carsten Dominik (dominik@science.uva.nl 
> ) wrote:
>> Hi Hsiu,
>>
>> nice hack.  But I am still wondering why you do not
>> use "primary filtering" for this, i.e. a tags search
>> for "project1|project2"
>>
>>     C-c a m project1|project2 RET
>
> I couldn't get such a search to work with a daily/weekly/monthly  
> agenda view.
> I was trying to restrict the weekly (say) agenda view to just two  
> projects
> (identified by tags), which seems like a nice view for scheduling  
> tasks.  I
> would love a simple way to do this.  If different projects were in  
> different
> files, then one can modify org-agenda-files temporarily to achieve  
> this, but my
> projects are not always cleanly separated that way.

Yes, you are right, for the agenda this cannot be achieved,
except for constructing your own org-agenda-skip-function.

- Carsten

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

end of thread, other threads:[~2009-01-13  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-09  1:55 Does secondary filtering allow multiple tags? Hsiu-Khuern Tang
2009-01-09  7:38 ` Carsten Dominik
2009-01-09 19:18   ` Hsiu-Khuern Tang
2009-01-09 19:32     ` Hsiu-Khuern Tang
2009-01-10 11:12     ` Carsten Dominik
2009-01-12 17:37       ` Hsiu-Khuern Tang
2009-01-13  9:18         ` 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).