summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-16 18:40:02 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-03-16 18:40:02 (GMT)
commitacbf00ea24696270d93e5d697a68edb5924d242c (patch)
tree3fc7d17606c242824d09996968aae7962e694dae
parent6b38452498c805ba04cb66007e6f2ea9f0df9f95 (diff)
downloadorg-mode-acbf00ea24696270d93e5d697a68edb5924d242c.zip
org-mode-acbf00ea24696270d93e5d697a68edb5924d242c.tar.gz
org-agenda.el (org-agenda-mode-map): Use ?= for filtering by regexp and ?| for removing all filters
* org-agenda.el (org-agenda-mode-map): Use ?= for filtering by regexp and ?| for removing all filters. (org-agenda-filter-remove-all): New command. (org-agenda-filter-show-all-re): Rename from `org-agenda-filter-show-all-regexp'. (org-agenda-filter-by-regexp): Call `org-agenda-filter-show-all-re'.
-rw-r--r--lisp/org-agenda.el17
1 files changed, 14 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 2a09405..aacf6f4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2290,7 +2290,8 @@ The following commands are available:
(org-defkey org-agenda-mode-map "{" 'org-agenda-manipulate-query-add-re)
(org-defkey org-agenda-mode-map "}" 'org-agenda-manipulate-query-subtract-re)
(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag)
-(org-defkey org-agenda-mode-map "|" 'org-agenda-filter-by-regexp)
+(org-defkey org-agenda-mode-map "=" 'org-agenda-filter-by-regexp)
+(org-defkey org-agenda-mode-map "|" 'org-agenda-filter-remove-all)
(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine)
(org-defkey org-agenda-mode-map "<" 'org-agenda-filter-by-category)
(org-defkey org-agenda-mode-map "^" 'org-agenda-filter-by-top-category)
@@ -7288,9 +7289,19 @@ With two prefix arguments, remove the regexp filters."
"Narrow to entries matching regexp: ")))))
(push flt org-agenda-regexp-filter)
(org-agenda-filter-apply org-agenda-regexp-filter 'regexp))
- (org-agenda-filter-show-all-regexp)
+ (org-agenda-filter-show-all-re)
(message "Regexp filter removed")))
+(defun org-agenda-filter-remove-all ()
+ "Remove all filters from the current agenda buffer."
+ (interactive)
+ (when org-agenda-tag-filter
+ (org-agenda-filter-show-all-tag))
+ (when org-agenda-category-filter
+ (org-agenda-filter-show-all-cat))
+ (when org-agenda-regexp-filter
+ (org-agenda-filter-show-all-re)))
+
(defun org-agenda-filter-by-tag (strip &optional char narrow)
"Keep only those lines in the agenda buffer that have a specific tag.
The tag is selected with its fast selection letter, as configured.
@@ -7541,7 +7552,7 @@ If the line does not have an effort defined, return nil."
org-agenda-filter-form nil)
(org-agenda-set-mode-name))
-(defun org-agenda-filter-show-all-regexp nil
+(defun org-agenda-filter-show-all-re nil
"Remove regexp filter overlays from the agenda buffer."
(mapc 'delete-overlay org-agenda-re-filter-overlays)
(setq org-agenda-re-filter-overlays nil