Function: todo-mark-category
todo-mark-category is an interactive and byte-compiled function
defined in todo-mode.el.gz.
Signature
(todo-mark-category)
Documentation
Mark all visible items in this category with todo-item-mark.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/todo-mode.el.gz
(defun todo-mark-category ()
"Mark all visible items in this category with `todo-item-mark'."
(interactive)
(let ((cat (todo-current-category)))
(save-excursion
(goto-char (point-min))
(while (not (eobp))
(let* ((marks (assoc cat todo-categories-with-marks))
(ov (todo-get-overlay 'prefix))
;; When done items are shown and there are no todo items, the
;; loop starts on the empty line in the todo items sections,
;; which has no overlay, so don't try to get it.
(pref (when ov (overlay-get ov 'before-string))))
(unless (or (todo-marked-item-p) (not ov))
(overlay-put ov 'before-string (concat todo-item-mark pref))
(if marks
(setcdr marks (1+ (cdr marks)))
(push (cons cat 1) todo-categories-with-marks))))
(todo-forward-item)
;; Don't try to mark the empty line between the todo and done
;; items sections.
(when (looking-at "^$")
(unless (eobp)
(todo-forward-item)))))))