summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2020-02-19 00:35:20 +0100
committerBastien <bzg@gnu.org>2020-02-19 00:35:20 +0100
commit7e52b7661249acf5167bc8d8d1562ac3fefc0cd6 (patch)
treefa8083b71fd2876955de9d019356220f9b2ef92a
parent2129ece3b5fe069e654317c58af558da1b86bdb2 (diff)
downloadorg-mode-7e52b7661249acf5167bc8d8d1562ac3fefc0cd6.tar.gz
org-agenda: Fix logic of `org-agenda-filter-make-matcher'
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Fix logic: only use 'or when including several categories as e.g. '("+cat1" "+cat2"). This fixes 06cf532f4.
-rw-r--r--lisp/org-agenda.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b2ad344..a8fc36f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7927,7 +7927,10 @@ These will be lower-case, for filtering."
"Create the form that tests a line for agenda filter. Optional
argument EXPAND can be used for the TYPE tag and will expand the
tags in the FILTER if any of the tags in FILTER are grouptags."
- (let (f f1)
+ (let ((multi-pos-cats
+ (string-match-p "\++"
+ (mapconcat (lambda (cat) (substring cat 0 1)) filter "")))
+ f f1)
(cond
;; Tag filter
((eq type 'tag)
@@ -7971,7 +7974,7 @@ tags in the FILTER if any of the tags in FILTER are grouptags."
filter)))
(dolist (x filter)
(push (org-agenda-filter-effort-form x) f))))
- (cons (if (eq type 'category) 'or 'and) (nreverse f))))
+ (cons (if multi-pos-cats 'or 'and) (nreverse f))))
(defun org-agenda-filter-make-matcher-tag-exp (tags op)
"Return a form associated to tag-expression TAGS.