emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Hsiu-Khuern Tang <hsiu-khuern.tang@hp.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Does secondary filtering allow multiple tags?
Date: Fri, 9 Jan 2009 11:32:28 -0800	[thread overview]
Message-ID: <20090109193227.GS24132@hplhtang1> (raw)
In-Reply-To: <20090109191823.GR24132@hplhtang1>

* 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.

  reply	other threads:[~2009-01-09 19:35 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 [this message]
2009-01-10 11:12     ` Carsten Dominik
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=20090109193227.GS24132@hplhtang1 \
    --to=hsiu-khuern.tang@hp.com \
    --cc=emacs-orgmode@gnu.org \
    /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).