Browse Source

org-agenda.el (org-agenda-filter-apply): Fix setting of `org-agenda-filtered-by-category'

* org-agenda.el (org-agenda-filter-apply): Fix setting of
`org-agenda-filtered-by-category'.
Bastien Guerry 3 years ago
parent
commit
5556865893
1 changed files with 6 additions and 7 deletions
  1. 6 7
      lisp/org-agenda.el

+ 6 - 7
lisp/org-agenda.el

@@ -7604,13 +7604,12 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
   ;; Deactivate `org-agenda-entry-text-mode' when filtering
   (if org-agenda-entry-text-mode (org-agenda-entry-text-mode))
   (let (tags cat txt)
-    (setq org-agenda-filter-form
-	  (org-agenda-filter-make-matcher filter type))
-    (if (and (eq type 'category)
-	     (not (equal (substring (car filter) 0 1) "-")))
-	;; Only set `org-agenda-filtered-by-category' to t
-	;; when a unique category is used as the filter
-	(setq org-agenda-filtered-by-category t))
+    (setq org-agenda-filter-form (org-agenda-filter-make-matcher filter type))
+    ;; Only set `org-agenda-filtered-by-category' to t when a unique
+    ;; category is used as the filter:
+    (setq org-agenda-filtered-by-category
+	  (and (eq type 'category)
+	       (not (equal (substring (car filter) 0 1) "-"))))
     (org-agenda-set-mode-name)
     (save-excursion
       (goto-char (point-min))