diff options
author | Kyle Meyer <kyle@kyleam.com> | 2020-04-06 23:07:51 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-04-07 22:47:37 -0400 |
commit | 561e9efd062e23321f3b56b2e3482ef3afc7416f (patch) | |
tree | 139dbc397540f228ff6c9100d2fea456900489b4 | |
parent | e3373f4beb16395f17e54c3494c0c7e53222ebcd (diff) | |
download | org-mode-561e9efd062e23321f3b56b2e3482ef3afc7416f.tar.gz |
agenda: Fix regression in handling of non-caterory filters
* lisp/org-agenda.el (org-agenda-filter-make-matcher): Combine filter
forms with `and' unless multiple positive categories are given.
06cf532f4 (org-agenda.el: Fix bug when using category filters,
2020-01-20) modified org-agenda-filter-make-matcher to group the form
with `or' rather than `and' for category filters. This logic was
tweaked again in a follow-up commit, 7e52b7661 (org-agenda: Fix logic
of `org-agenda-filter-make-matcher', 2020-02-19), which was supposed
to restrict the use of `or' to _multiple_ positive categories.
However, the follow-up commit incorrectly affected all filter types.
Avoid the check for non-category types.
Also, fix the regexp so that it matches whenever there are multiple
positive categories, not just a single one.
Reported-by: Jorge P. de Morais Neto <jorge+list@disroot.org>
<87v9nhit6c.fsf@disroot.org>
-rw-r--r-- | lisp/org-agenda.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index a8fc36f..03a3a00 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7928,8 +7928,10 @@ These will be lower-case, for filtering." 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 ((multi-pos-cats - (string-match-p "\++" - (mapconcat (lambda (cat) (substring cat 0 1)) filter ""))) + (and (eq type 'category) + (string-match-p "\\+.*\\+" + (mapconcat (lambda (cat) (substring cat 0 1)) + filter "")))) f f1) (cond ;; Tag filter |