summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2020-02-17 08:20:48 +0100
committerBastien <bzg@gnu.org>2020-02-17 08:20:55 +0100
commite8402f3cad40f161712c4d1e9ed8f207315f898f (patch)
treee262601187f36054eb2115a9df650d16e86a1715
parent1a7e4627fa0738ebec24a95b5a21e254008f864a (diff)
downloadorg-mode-e8402f3cad40f161712c4d1e9ed8f207315f898f.tar.gz
org-agenda.el: Let `org-agenda-filter' consider group tags
* lisp/org-agenda.el (org-agenda-filter): Expand group tags. (org-agenda-get-represented-tags): Consider group tags represented when one tag of the group is represented.
-rw-r--r--lisp/org-agenda.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ac3fee5..cc41b48 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7731,7 +7731,7 @@ the variable `org-agenda-auto-exclude-function'."
(and fc (org-agenda-filter-apply
(setq org-agenda-category-filter fc) 'category))
(and ft (org-agenda-filter-apply
- (setq org-agenda-tag-filter ft) 'tag))
+ (setq org-agenda-tag-filter ft) 'tag 'expand))
(and fe (org-agenda-filter-apply
(setq org-agenda-effort-filter fe) 'effort))
(and fr (org-agenda-filter-apply
@@ -7889,6 +7889,7 @@ also press `-' or `+' to switch between filtering and excluding."
(setq org-agenda-represented-categories
(nreverse (org-uniquify (delq nil categories))))))))
+(defvar org-tag-groups-alist-for-agenda)
(defun org-agenda-get-represented-tags ()
"Return a list of all tags used in this agenda buffer.
These will be lower-case, for filtering."
@@ -7900,9 +7901,16 @@ These will be lower-case, for filtering."
pos 'tags nil (point-max))))
(setq tt (get-text-property pos 'tags))
(if tt (push tt tags-lists)))
- (setq org-agenda-represented-tags
+ (setq tags-lists
(nreverse (org-uniquify
- (delq nil (apply 'append tags-lists)))))))))
+ (delq nil (apply 'append tags-lists)))))
+ (dolist (tag tags-lists)
+ (mapc
+ (lambda (group)
+ (when (member tag (mapcar #'downcase group))
+ (push (downcase (car group)) tags-lists)))
+ org-tag-groups-alist-for-agenda))
+ (setq org-agenda-represented-tags tags-lists)))))
(defun org-agenda-filter-make-matcher (filter type &optional expand)
"Create the form that tests a line for agenda filter. Optional