[Top][All Lists]

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

Re: Bug: org-agenda-tag-filter-preset not respected [9.3.6 (9.3.6-19-gf3

From: Kyle Meyer
Subject: Re: Bug: org-agenda-tag-filter-preset not respected [9.3.6 (9.3.6-19-gf360f9-elpaplus @ /home/jorge/.config/emacs/elpa/27.0/develop/org-plus-contrib-20200302/)]
Date: Tue, 07 Apr 2020 03:33:33 +0000

Nicolas Goaziou <address@hidden> writes:

> Unfortunately, no one volunteered to fix the issue so far. You may want
> to have a look at it, you will certainly get help doing so. Otherwise,
> you are welcome to bump the report from time to time.

This bisects to 7e52b7661 (org-agenda: Fix logic of
`org-agenda-filter-make-matcher', 2020-02-19).  Jorge, I tested the
patch below against the test case you provided, though of course
confirmation that it resolves the issue on your end would be

I'll apply it tomorrow unless there are objections.

-- >8 --
Subject: [PATCH] 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.

  * I'm tempted to drop the multi-pos-cats binding and move the
    expression in line.  I may do that before applying.

  * I'm not really sure what the behavior should be when there are
    multiple "+"s and at least one "-".  I doubt that there's much
    sensible to do here, or that it matters one way or the other.

 lisp/org-agenda.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index d89a3da7c..ffb892b0c 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7948,8 +7948,10 @@ (defun org-agenda-filter-make-matcher (filter type 
&optional expand)
 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)
      ;; Tag filter

reply via email to

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