瀏覽代碼

org-agenda.el: Fix a bug in category filtering

* org-agenda.el (org-prepare-agenda): Minor code clean-up.
(org-agenda-filter-by-category): Filtering must be turned off
only when a category filter has been set and this filter is
not empty.
Bastien Guerry 12 年之前
父節點
當前提交
6a69ceaed6
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      lisp/org-agenda.el

+ 4 - 2
lisp/org-agenda.el

@@ -3300,7 +3300,8 @@ generating a new one."
     (unless org-agenda-persistent-filter
       (setq org-agenda-tag-filter nil
 	    org-agenda-category-filter nil))
-    (put 'org-agenda-tag-filter :preset-filter org-agenda-tag-filter-preset)
+    (put 'org-agenda-tag-filter :preset-filter
+	 org-agenda-tag-filter-preset)
     (put 'org-agenda-category-filter :preset-filter
 	 org-agenda-category-filter-preset)
     (if org-agenda-multi
@@ -6518,7 +6519,8 @@ When this is the global TODO list, a prefix argument will be interpreted."
   "Keep only those lines in the agenda buffer that have a specific category.
 The category is that of the current line."
   (interactive "P")
-  (if org-agenda-filtered-by-category
+  (if (and org-agenda-filtered-by-category
+	   org-agenda-category-filter)
       (org-agenda-filter-show-all-cat)
     (let ((cat (org-no-properties (get-text-property (point) 'org-category))))
       (if cat (org-agenda-filter-apply