emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Does secondary filtering allow multiple tags?


From: Hsiu-Khuern Tang
Subject: Re: [Orgmode] Does secondary filtering allow multiple tags?
Date: Fri, 9 Jan 2009 11:32:28 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

* On Fri 07:18PM +0000, 09 Jan 2009, Hsiu-Khuern Tang (address@hidden) 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 via email to

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