Function: todo-set-top-priorities
todo-set-top-priorities is a byte-compiled function defined in
todo-mode.el.gz.
Signature
(todo-set-top-priorities &optional ARG)
Documentation
Set number of top priorities shown by todo-filter-top-priorities.
With non-nil ARG, set the number only for the current Todo category; otherwise, set the number for all categories in the current todo file.
Calling this function via either of the commands
todo-set-top-priorities-in-file or
todo-set-top-priorities-in-category is the recommended way to
set the user customizable option todo-top-priorities-overrides.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/todo-mode.el.gz
(defun todo-set-top-priorities (&optional arg)
"Set number of top priorities shown by `todo-filter-top-priorities'.
With non-nil ARG, set the number only for the current Todo
category; otherwise, set the number for all categories in the
current todo file.
Calling this function via either of the commands
`todo-set-top-priorities-in-file' or
`todo-set-top-priorities-in-category' is the recommended way to
set the user customizable option `todo-top-priorities-overrides'."
(let* ((cat (todo-current-category))
(file todo-current-todo-file)
(rules todo-top-priorities-overrides)
(frule (assoc-string file rules))
(crules (nth 2 frule))
(crule (assoc-string cat crules))
(fcur (or (nth 1 frule)
todo-top-priorities))
(ccur (or (and arg (cdr crule))
fcur))
(prompt (if arg (concat "Number of top priorities in this category"
" (currently %d): ")
(concat "Default number of top priorities per category"
" in this file (currently %d): ")))
(new -1))
(while (< new 0)
(let ((cur (if arg ccur fcur)))
(setq new (read-number (format prompt cur))
prompt "Enter a non-negative number: "
cur nil)))
(let ((nrule (if arg
(append (delete crule crules) (list (cons cat new)))
(append (list file new) (list crules)))))
(setq rules (cons (if arg
(list file fcur nrule)
nrule)
(delete frule rules)))
(customize-save-variable 'todo-top-priorities-overrides rules)
(todo-prefix-overlays))))