emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Hsiu-Khuern Tang <hsiu-khuern.tang@hp.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Does secondary filtering allow multiple tags?
Date: Sat, 10 Jan 2009 12:12:44 +0100	[thread overview]
Message-ID: <7E3B0BA7-E3AD-43A4-9CDF-5CC179A3A387@uva.nl> (raw)
In-Reply-To: <20090109191823.GR24132@hplhtang1>

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

  parent reply	other threads:[~2009-01-10 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-01-12 17:37       ` Hsiu-Khuern Tang
2009-01-13  9:18         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7E3B0BA7-E3AD-43A4-9CDF-5CC179A3A387@uva.nl \
    --to=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --cc=hsiu-khuern.tang@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).