Function: todo-display-categories

todo-display-categories is a byte-compiled function defined in todo-mode.el.gz.

Signature

(todo-display-categories)

Documentation

Prepare buffer for displaying table of categories and item counts.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/todo-mode.el.gz
(defun todo-display-categories ()
  "Prepare buffer for displaying table of categories and item counts."
  (unless (eq major-mode 'todo-categories-mode)
    (setq todo-global-current-todo-file
	  (or todo-current-todo-file
	      (todo-absolute-file-name todo-default-todo-file)))
    (set-window-buffer (selected-window)
		       (set-buffer (get-buffer-create todo-categories-buffer)))
    (kill-all-local-variables)
    (todo-categories-mode)
    (let ((archive (member todo-current-todo-file todo-archives))
	  (inhibit-read-only t))
      (erase-buffer)
      (insert (format (concat "Category counts for todo "
			      (if archive "archive" "file")
			      " \"%s\".")
		      (todo-short-file-name todo-current-todo-file)))
      (newline 2)
      ;; Make space for the column of category numbers.
      (insert (make-string (+ 4 (length todo-categories-number-separator)) 32))
      ;; Add the category and item count buttons (if this is the list of
      ;; categories in an archive, show only done item counts).
      (todo-insert-sort-button todo-categories-category-label)
      (if archive
	  (progn
	    (insert (make-string 3 32))
	    (todo-insert-sort-button todo-categories-done-label))
	(insert (make-string 3 32))
	(todo-insert-sort-button todo-categories-todo-label)
	(insert (make-string 2 32))
	(todo-insert-sort-button todo-categories-diary-label)
	(insert (make-string 2 32))
	(todo-insert-sort-button todo-categories-done-label)
	(insert (make-string 2 32))
	(todo-insert-sort-button todo-categories-archived-label))
      (newline 2))))