Function: org-agenda-filter-by-regexp

org-agenda-filter-by-regexp is an interactive and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-filter-by-regexp STRIP-OR-ACCUMULATE)

Documentation

Filter agenda entries by a regular expressions.

You will be prompted for the regular expression, and the agenda view will only show entries that are matched by that expression.

With one C-u (universal-argument) prefix argument, hide entries matching the regexp. When there is already a regexp filter active, this command removed the filter. However, with two C-u (universal-argument) prefix arguments, add a new condition to an already existing regexp filter.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-filter-by-regexp (strip-or-accumulate)
  "Filter agenda entries by a regular expressions.
You will be prompted for the regular expression, and the agenda
view will only show entries that are matched by that expression.

With one `\\[universal-argument]' prefix argument, hide entries matching the regexp.
When there is already a regexp filter active, this command removed the
filter.  However, with two `\\[universal-argument]' prefix arguments, add a new condition to
an already existing regexp filter."
  (interactive "P")
  (let* ((strip (equal strip-or-accumulate '(4)))
	 (accumulate (equal strip-or-accumulate '(16))))
    (cond
     ((and org-agenda-regexp-filter (not accumulate))
      (org-agenda-filter-show-all-re)
      (message "Regexp filter removed"))
     (t (let ((flt (concat (if strip "-" "+")
			   (read-from-minibuffer
			    (if strip
				"Hide entries matching regexp: "
			      "Narrow to entries matching regexp: ")))))
	  (push flt org-agenda-regexp-filter)
	  (org-agenda-filter-apply org-agenda-regexp-filter 'regexp))))))