Function: org-show-todo-tree

org-show-todo-tree is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-show-todo-tree ARG)

Documentation

Make a compact tree which shows all headlines marked with TODO.

The tree will show the lines where the regexp matches, and all higher headlines above the match. With a C-u (universal-argument) prefix, prompt for a regexp to match. With a numeric prefix N, construct a sparse tree for the Nth element of org-todo-keywords-1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-show-todo-tree (arg)
  "Make a compact tree which shows all headlines marked with TODO.
The tree will show the lines where the regexp matches, and all higher
headlines above the match.
With a `\\[universal-argument]' prefix, prompt for a regexp to match.
With a numeric prefix N, construct a sparse tree for the Nth element
of `org-todo-keywords-1'."
  (interactive "P")
  (let ((case-fold-search nil)
	(kwd-re
	 (cond ((null arg) (concat org-not-done-regexp "\\s-"))
	       ((equal arg '(4))
		(let ((kwd
		       (completing-read "Keyword (or KWD1|KWD2|...): "
					(mapcar #'list org-todo-keywords-1))))
		  (concat "\\("
			  (mapconcat #'regexp-quote (org-split-string kwd "|") "\\|")
			  "\\)\\(?:[ \t]\\|$\\)")))
	       ((<= (prefix-numeric-value arg) (length org-todo-keywords-1))
		(regexp-quote (nth (1- (prefix-numeric-value arg))
				   org-todo-keywords-1)))
	       (t (user-error "Invalid prefix argument: %s" arg)))))
    (message "%d TODO entries found"
	     (org-occur (concat "^" org-outline-regexp " *" kwd-re )))))