Function: org-agenda-limit-interactively

org-agenda-limit-interactively is an interactive and byte-compiled function defined in org-agenda.el.gz.

Signature

(org-agenda-limit-interactively REMOVE)

Documentation

In agenda, interactively limit entries to various maximums.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-limit-interactively (remove)
  "In agenda, interactively limit entries to various maximums."
  (interactive "P")
  (if remove
      (progn (setq org-agenda-max-entries nil
		   org-agenda-max-todos nil
		   org-agenda-max-tags nil
		   org-agenda-max-effort nil)
	     (org-agenda-redo))
    (let* ((max (read-char "Number of [e]ntries [t]odos [T]ags [E]ffort? "))
	   (msg (cond ((= max ?E) "How many minutes? ")
		      ((= max ?e) "How many entries? ")
		      ((= max ?t) "How many TODO entries? ")
		      ((= max ?T) "How many tagged entries? ")
		      (t (user-error "Wrong input"))))
	   (num (string-to-number (read-from-minibuffer msg))))
      (cond ((equal max ?e)
	     (let ((org-agenda-max-entries num)) (org-agenda-redo)))
	    ((equal max ?t)
	     (let ((org-agenda-max-todos num)) (org-agenda-redo)))
	    ((equal max ?T)
	     (let ((org-agenda-max-tags num)) (org-agenda-redo)))
	    ((equal max ?E)
	     (let ((org-agenda-max-effort num)) (org-agenda-redo))))))
  (org-agenda-fit-window-to-buffer))