Browse Source

org-agenda.el (org-agenda-filter-by-category): Display all filtered out categories

* org-agenda.el (org-agenda-filter-by-category): Display all
filtered out categories.

TINYCHANGE
Gustav Wikström 4 years ago
parent
commit
edcf9c95eb
1 changed files with 9 additions and 6 deletions
  1. 9 6
      lisp/org-agenda.el

+ 9 - 6
lisp/org-agenda.el

@@ -7307,12 +7307,15 @@ The category is that of the current line."
 	   org-agenda-category-filter)
       (org-agenda-filter-show-all-cat)
     (let ((cat (org-no-properties (get-text-property (point) 'org-category))))
-      (if (and cat (not (string= "" cat)))
-	  (org-agenda-filter-apply
-	   (setq org-agenda-category-filter
-		 (list (concat (if strip "-" "+") cat)))
-	   'category)
-	(error "No category at point")))))
+      (cond
+       ((and cat strip)
+        (org-agenda-filter-apply
+         (push (concat "-" cat) org-agenda-category-filter) 'category))
+       ((and cat)
+        (org-agenda-filter-apply
+         (setq org-agenda-category-filter
+	       (list (concat "+" cat))) 'category))
+       ((error "No category at point"))))))
 
 (defun org-find-top-headline (&optional pos)
   "Find the topmost parent headline and return it."