;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:37:31 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/calendar/todo-mode.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`todo-mode.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'todo nil "Maintain a list of todo items." :link '(emacs-commentary-link "todo-mode") :version "21.1" :group 'calendar)
#@486 *TODO mode prefix for entries.

This is useful in conjunction with `calendar' and `diary' if you use

#include "~/.todo-do"

in your diary file to include your todo list file as part of your
diary.  With the default value "*/*" the diary displays each entry
every day and it may also be marked on every day of the calendar.
Using "&%%(equal (calendar-current-date) date)" instead will only
show and mark todo entreis for today, but may slow down processing of
the diary file somewhat.
(custom-declare-variable 'todo-prefix '"*/*" '(#$ . -772) :type 'string :group 'todo)
#@23 *TODO mode list file.
(custom-declare-variable 'todo-file-do '"~/.todo-do" '(#$ . -1349) :type 'file :group 'todo)
#@26 *TODO mode archive file.
(custom-declare-variable 'todo-file-done '"~/.todo-done" '(#$ . -1470) :type 'file :group 'todo)
#@19 *TODO mode hooks.
(custom-declare-variable 'todo-mode-hook 'nil '(#$ . -1598) :type 'hook :group 'todo)
#@24 *TODO Edit mode hooks.
(custom-declare-variable 'todo-edit-mode-hook 'nil '(#$ . -1708) :type 'hook :group 'todo)
#@709 *TODO mode insertion accuracy.

If you have 8 items in your TODO list, then you may get asked 4
questions by the binary insertion algorithm.  However, you may not
really have a need for such accurate priorities amongst your TODO
items.  If you now think about the binary insertion halfing the size
of the window each time, then the threshhold is the window size at
which it will stop.  If you set the threshhold to zero, the upper and
lower bound will coincide at the end of the loop and you will insert
your item just before that point.  If you set the threshhold to,
e.g. 8, it will stop as soon as the window size drops below that
amount and will insert the item in the approximate centre of that
window.
(custom-declare-variable 'todo-insert-threshold '0 '(#$ . -1829) :type 'integer :group 'todo)
#@24 TODO Edit buffer name.
(defvar todo-edit-buffer " *TODO Edit*" (#$ . 2637))
#@144 *TODO mode top priorities file.

Not in TODO format, but diary compatible.
Automatically generated when `todo-save-top-priorities' is non-nil.
(custom-declare-variable 'todo-file-top '"~/.todo-top" '(#$ . -2720) :type 'string :group 'todo)
#@40 *Function to print the current buffer.
(custom-declare-variable 'todo-print-function ''ps-print-buffer-with-faces '(#$ . -2966) :type 'symbol :group 'todo)
#@92 *Default number of priorities to show by \[todo-top-priorities].
0 means show all entries.
(custom-declare-variable 'todo-show-priorities '1 '(#$ . -3128) :type 'integer :group 'todo)
#@85 *Default number of priorities to print by \[todo-print].
0 means print all entries.
(custom-declare-variable 'todo-print-priorities '0 '(#$ . -3318) :type 'integer :group 'todo)
#@84 *Non-nil to remove category separators in\[todo-top-priorities] and \[todo-print].
(custom-declare-variable 'todo-remove-separator 't '(#$ . -3502) :type 'boolean :group 'todo)
#@82 *Non-nil makes `todo-save' automatically save top-priorities in `todo-file-top'.
(custom-declare-variable 'todo-save-top-priorities-too 't '(#$ . -3685) :type 'boolean :group 'todo)
#@99 *TODO mode time string format for done entries.
For details see the variable `time-stamp-format'.
(custom-declare-variable 'todo-time-string-format '"%:y-%02m-%02d %02H:%02M" '(#$ . -3873) :type 'string :group 'todo)
#@60 *Function producing text to insert at start of todo entry.
(custom-declare-variable 'todo-entry-prefix-function ''todo-entry-timestamp-initials '(#$ . -4096) :type 'symbol :group 'todo)
#@32 *Initials of todo item author.
(custom-declare-variable 'todo-initials '(or (getenv "INITIALS") (user-login-name)) '(#$ . -4288) :type 'string :group 'todo)
(autoload 'time-stamp-string "time-stamp")
#@66 Prepend timestamp and your initials to the head of a TODO entry.
(defalias 'todo-entry-timestamp-initials #[nil "\303 \304\n\305R)\207" [todo-time-string-format time-stamp-format todo-initials time-stamp-string " " ": "] 4 (#$ . 4494)])
#@18 TODO categories.
(defvar todo-categories nil (#$ . 4739))
#@78 Old variable for holding the TODO categories.
Use `todo-categories' instead.
(defvar todo-cats nil (#$ . 4803))
#@28 Previous line asked about.
(defvar todo-previous-line 0 (#$ . 4921))
#@22 Previous answer got.
(defvar todo-previous-answer 0 (#$ . 4996))
#@19 TODO mode keymap.
(defvar todo-mode-map (byte-code "\301 \302\303\"\210\304\305\306#\210\304\307\310#\210\304\311\312#\210\304\313\314#\210\304\315\316#\210\304\317\312#\210\304\320\321#\210\304\322\323#\210\304\324\325#\210\304\326\327#\210\304\330\331#\210\304\332\333#\210\304\334\335#\210\304\336\337#\210\304\340\341#\210\304\342\343#\210\304\344\345#\210\304\346\347#\210\304\350\351#\210)\207" [map make-keymap suppress-keymap t define-key "+" todo-forward-category "-" todo-backward-category "d" todo-file-item "e" todo-edit-item "E" todo-edit-multiline "f" "i" todo-insert-item "I" todo-insert-item-here "j" todo-jump-to-category "k" todo-delete-item "l" todo-lower-item "n" todo-forward-item "p" todo-backward-item "P" todo-print "q" todo-quit "r" todo-raise-item "s" todo-save "S" todo-save-top-priorities "t" todo-top-priorities] 4) (#$ . 5067))
#@23 TODO category number.
(defvar todo-category-number 0 (#$ . 5953))
(byte-code "\301B\302\301!\204\f \303\301\207" [current-load-list todo-tmp-buffer-name boundp " *todo tmp*"] 2)
#@21 Category separator.
(defvar todo-category-sep (make-string 75 45) (#$ . 6140))
#@62 Category start separator to be prepended onto category name.
(defvar todo-category-beg " --- " (#$ . 6225))
#@29 Separator after a category.
(defvar todo-category-end "--- End" (#$ . 6339))
#@23 Header of todo files.
(defvar todo-header "-*- mode: todo; " (#$ . 6422))
#@56 Make TODO mode display the current category correctly.
(defalias 'todo-category-select #[nil "	8\306\307\310\n\"P~\210eb\210\311\312\313\f\nQ!\314Q!\210\315 T\311\312P!\210\316 }\210eb*\207" [todo-category-number todo-categories name mode-line-buffer-identification todo-prefix todo-category-beg "Category: " format "%18s" search-forward-regexp "^" regexp-quote "$" line-end-position line-beginning-position begin todo-category-end] 6 (#$ . 6502)])
(defalias 'todo-cat-slct 'todo-category-select)
#@43 Go forward to TODO list of next category.
(defalias 'todo-forward-category #[nil "\302T	G\"\303 \207" [todo-category-number todo-categories mod todo-category-select] 3 (#$ . 7015) nil])
(defalias 'todo-cmd-forw 'todo-forward-category)
#@44 Go back to TODO list of previous category.
(defalias 'todo-backward-category #[nil "\302S	G\"\303 \207" [todo-category-number todo-categories mod todo-category-select] 3 (#$ . 7258) nil])
(defalias 'todo-cmd-back 'todo-backward-category)
#@37 Select previous entry of TODO list.
(defalias 'todo-backward-item #[nil "\301\302\303!P\304\305#\210\306\307!\207" [todo-prefix search-backward-regexp "^" regexp-quote nil t message ""] 4 (#$ . 7504) nil])
(defalias 'todo-cmd-prev 'todo-backward-item)
#@42 Select COUNT-th next entry of TODO list.
(defalias 'todo-forward-item #[(&optional count) "<\203 @\302\210\303\304\305	!P\302\306$\210\307 \210\310\311!\207" [count todo-prefix nil search-forward-regexp "^" regexp-quote goto-end beginning-of-line message ""] 5 (#$ . 7763) "P"])
(defalias 'todo-cmd-next 'todo-forward-item)
#@21 Save the TODO list.
(defalias 'todo-save #[nil "\212\214\301 \210\205 \302 *\207" [todo-save-top-priorities-too save-buffer todo-save-top-priorities] 1 (#$ . 8099) nil])
(defalias 'todo-cmd-save 'todo-save)
#@30 Done with TODO list for now.
(defalias 'todo-quit #[nil "~\210\300 \210\301\302!\210\303 \207" [todo-save message "" bury-buffer] 2 (#$ . 8314) nil])
(defalias 'todo-cmd-done 'todo-quit)
#@31 Edit current TODO list entry.
(defalias 'todo-edit-item #[nil "\302 \303!\203 \304 \202\" \305\306\"\307 \210	\310\261\210\311 \210\312\313!))\207" [item new todo-item-string todo-string-multiline-p todo-edit-multiline read-from-minibuffer "Edit: " todo-remove-item "\n" todo-backward-item message ""] 3 (#$ . 8507) nil])
(defalias 'todo-cmd-edit 'todo-edit-item)
#@58 Set up a buffer for editing a multiline TODO list entry.
(defalias 'todo-edit-multiline #[nil "\303!\304\305\306\n!	\"!\210\307\310!\210\311 \210\312 \313 })\207" [todo-edit-buffer buffer-name todo-file-do generate-new-buffer-name switch-to-buffer make-indirect-buffer file-name-nondirectory message "To exit, simply kill this buffer and return to list." todo-edit-mode todo-item-start todo-item-end] 4 (#$ . 8883) nil])
#@40 Add new category CAT to the TODO list.
(defalias 'todo-add-category #[(cat) "\300\213\210\301\207" [((byte-code "	B\306\n!\210~\210eb\210\307\310\311\312#\211\203 b\210\313\232\203) \314c\210\315u\210\202, \316 \210)\317\320	\"c\210\321u\210\317\322\f\f&c\207" [cat todo-categories todo-file-do posn todo-prefix todo-category-beg find-file search-forward "-*- mode: todo; " 17 t nil "-*- mode: todo; \n" -1 kill-line format "todo-categories: %S; -*-" 1 "%s%s%s\n%s\n%s %s\n" todo-category-end todo-category-sep] 9)) 0] 1 (#$ . 9312) "sCategory: "])
#@58 Insert NEW-ITEM in TODO list as a new entry in CATEGORY.
(defalias 'todo-add-item-non-interactively #[(new-item category) "\212\306 \210)\212\307\230\203 	\n8\n\235\211\203  \nGGZ\202# \310!)\306 \210\311\312\313ed\"TZV\203d \\\314\245\211W\205O \315!\211\203[ \202` T*\2023 \\\314\245eb\210Sy\210*\316\261\210\317 \210\320 \210\321\307!)\207" [category todo-category-number todo-categories cat-exists todo-previous-line bottom todo-show "" todo-add-category 0 1 count-lines 2 todo-more-important-p "\n" todo-backward-item todo-save message top todo-insert-threshold current answer new-item] 5 (#$ . 9880)])
#@110 Insert new TODO list entry.
With a prefix argument solicit the category, otherwise use the current
category.
(defalias 'todo-insert-item #[(arg) "\212\306\230\204\n \307 \210	\310\311\312\n\205 \n \"Q\f\305TB\f8\2030 \202A \313\314\315Q\316 \317\211\211&\320\".\207" [mode-name todo-prefix todo-entry-prefix-function new-item todo-categories categories "TODO" todo-show " " read-from-minibuffer "New TODO entry: " completing-read "Category [" "]: " todo-category-alist nil todo-add-item-non-interactively todo-category-number history current-category arg category] 8 (#$ . 10539) "P"])
(defalias 'todo-cmd-inst 'todo-insert-item)
#@46 Insert new TODO list entry under the cursor.
(defalias 'todo-insert-item-here #[nil "\212\304\230\204\n \305 \210	\306\307\310\n\205 \n \"Q\211\311Pc*\207" [mode-name todo-prefix todo-entry-prefix-function new-item "TODO" todo-show " " read-from-minibuffer "New TODO entry: " "\n"] 6 (#$ . 11204) ""])
#@59 Ask whether entry is more important than the one at LINE.
(defalias 'todo-more-important-p #[(line) "	\232\204 	eb\210Sy\210\304 \305\306\n\307Q!)\207" [todo-previous-line line item todo-previous-answer todo-item-string-start y-or-n-p "More important than '" "'? "] 4 (#$ . 11515)])
(defalias 'todo-ask-p 'todo-more-important-p)
#@33 Delete current TODO list entry.
(defalias 'todo-delete-item #[nil "\302ed\"\303V\203\" \304 \305\306\307Q!\211\203 \310 \210\311 \210\312\313!*\207\314\315!\207" [todo-entry todo-answer count-lines 0 todo-item-string-start y-or-n-p "Permanently remove '" "'? " todo-remove-item todo-backward-item message "" error "No TODO list entry to delete"] 5 (#$ . 11857) nil])
(defalias 'todo-cmd-kill 'todo-delete-item)
#@34 Raise priority of current entry.
(defalias 'todo-raise-item #[nil "\301e`\"\302V\203 \303 \304 \210\305 \210\212\306\261\210)\307\310!)\207\311\312!\207" [item count-lines 0 todo-item-string todo-remove-item todo-backward-item "\n" message "" error "No TODO list entry to raise"] 3 (#$ . 12278) nil])
(defalias 'todo-cmd-rais 'todo-raise-item)
#@34 Lower priority of current entry.
(defalias 'todo-lower-item #[nil "\301`d\"\302V\203 \303 \304 \210\305 \210\212\306\261\210)\307\310!)\207\311\312!\207" [item count-lines 1 todo-item-string todo-remove-item todo-forward-item "\n" message "" error "No TODO list entry to lower"] 3 (#$ . 12632) nil])
(defalias 'todo-cmd-lowr 'todo-lower-item)
#@76 File the current TODO list entry away, annotated with an optional COMMENT.
(defalias 'todo-file-item #[(&optional comment) "\306ed\"\307V\204 \310\311!\210\n\2036 \nG\307V\2036 \312 b\210\212\313 \210\314\315!!)\203/ \316\2020 \317\320\n\321\261\210\312 b\210\322\f8\323\261\210\324 b\210`\314\315!!\203Y \325\326 !\210\202] \326 c\210\327\312 T#\210\312 T|\210)\330 \210\331\332!)\207" [todo-time-string-format time-stamp-format comment todo-prefix todo-category-number todo-categories count-lines 0 error "No TODO list entry to file away" todo-item-end beginning-of-line looking-at regexp-quote " " "\n	" "(" ")" " [" "]" todo-item-start replace-match time-stamp-string append-to-file todo-backward-item message "" temp-point todo-file-done] 4 (#$ . 12985) "sComment: "])
#@236 List top priorities for each category.

Number of entries for each category is given by NOF-PRIORITIES which
defaults to 'todo-show-priorities'.

If CATEGORY-PR-PAGE is non-nil, a page separator '^L' is inserted
between each category.
(defalias 'todo-top-priorities #[(&optional nof-priorities category-pr-page) "\204 	<\203 @\n\203 \306\202 \307\f\203+ \310\311!\312\310\260\202. \310P\260\313\211 \314 \210\212\214~\210\315 ed#\210 q\210eb\210\316\311!!\313\317#\203e \320\321!\210`\322 |\210\316\311\"P!\313\317#\203\257 \322 T\316\313\317#\210\323\224\324!\210}\210eb\210\323U\203\236 b\210\202\242 \325!\210`\211|\210~\210\202e \326\306!\203\271 \324\307!\210eb\210*\327 !\210\330\331 \"-\207" [nof-priorities todo-show-priorities todo-tmp-buffer-name category-pr-page todo-remove-separator todo-category-end "\f" "" "\n" regexp-quote " " nil todo-show copy-to-buffer re-search-forward t beginning-of-line 1 line-end-position 0 replace-match todo-forward-item looking-at display-buffer message "Type C-x 1 to remove %s window.  M-C-v to scroll the help." todo-prefix todo-category-sep end beg cat-end todo-category-break todo-print-buffer-name todo-header todo-category-beg] 9 (#$ . 13782) "P"])
#@165 Save top priorities for each category in `todo-file-top'.

Number of entries for each category is given by NOF-PRIORITIES which
defaults to `todo-show-priorities'.
(defalias 'todo-save-top-priorities #[(&optional nof-priorities) "\300\213\207" [((byte-code "\212\214\303!\210	q\210\304\n!\210\305 *\207" [nof-priorities todo-tmp-buffer-name todo-file-top todo-top-priorities write-file kill-this-buffer] 2))] 1 (#$ . 15045) "P"])
#@212 Print todo summary using `todo-print-function'.
If CATEGORY-PR-PAGE is non-nil, a page separator `^L' is inserted
between each category.

Number of entries for each category is given by `todo-print-priorities'.
(defalias 'todo-print #[(&optional category-pr-page) "\300\213\207" [((byte-code "\212\214\304	\"\210\nq\210 \203 \305 \210\306\307!*\207" [todo-print-priorities category-pr-page todo-tmp-buffer-name todo-print-function todo-top-priorities kill-this-buffer message "Todo printing done."] 3))] 1 (#$ . 15483) "P"])
#@52 Jump to a category.  Default is previous category.
(defalias 'todo-jump-to-category #[nil "\301\nTB\n8\306\307\f\310Q\311 \312\211\211\f&\211\313\230\203$ \n8\235\2034 G\235GZ\2027 \314!\315 ,\207" [todo-categories categories todo-category-number history default category completing-read "Category [" "]: " todo-category-alist nil "" todo-add-category todo-show] 9 (#$ . 16017) nil])
#@44 Return current line in buffer as a string.
(defalias 'todo-line-string #[nil "\300 \301 {\207" [line-beginning-position line-end-position] 2 (#$ . 16424)])
#@55 Return the start of this TODO list entry as a string.
(defalias 'todo-item-string-start #[nil "\301 \211G\302V\203 \303\304O\305P)\207" [item todo-item-string 60 0 56 "..."] 4 (#$ . 16586)])
#@50 Return point at start of current TODO list item.
(defalias 'todo-item-start #[nil "\212\301 \210\302\303!!\204 \304\305\303!P\306\307#\210`)\207" [todo-prefix beginning-of-line looking-at regexp-quote search-backward-regexp "^" nil t] 4 (#$ . 16788)])
#@48 Return point at end of current TODO list item.
(defalias 'todo-item-end #[nil "\212\301\210\302\303\304!P\301\305#\210\306 S)\207" [todo-prefix nil search-forward-regexp "^" regexp-quote goto-end line-beginning-position] 4 (#$ . 17049)])
#@46 Delete the current entry from the TODO list.
(defalias 'todo-remove-item #[nil "\300 \301 T|\207" [todo-item-start todo-item-end] 2 (#$ . 17295)])
#@45 Return current TODO list entry as a string.
(defalias 'todo-item-string #[nil "\300 \301 {\207" [todo-item-start todo-item-end] 2 (#$ . 17448)])
#@42 Return the number of lines STRING spans.
(defalias 'todo-string-count-lines #[(string) "\301\302\"G\207" [string split-string "\n"] 3 (#$ . 17599)])
#@47 Return non-nil if STRING spans several lines.
(defalias 'todo-string-multiline-p #[(string) "\301!\302V\207" [string todo-string-count-lines 1] 2 (#$ . 17755)])
#@72 Generate an alist for use in `completing-read' from `todo-categories'.
(defalias 'todo-category-alist #[nil "\301\302\"\207" [todo-categories mapcar list] 3 (#$ . 17923)])
#@11 Todo Menu
(defvar todo-menu nil (#$ . 18102))
(easy-menu-do-define 'todo-menu todo-mode-map "Todo Menu" '("Todo" ["Next category" todo-forward-category t] ["Previous category" todo-backward-category t] ["Jump to category" todo-jump-to-category t] ["Show top priority items" todo-top-priorities t] ["Print categories" todo-print t] "---" ["Edit item" todo-edit-item t] ["File item" todo-file-item t] ["Insert new item" todo-insert-item t] ["Insert item here" todo-insert-item-here t] ["Kill item" todo-delete-item t] "---" ["Lower item priority" todo-lower-item t] ["Raise item priority" todo-raise-item t] "---" ["Next item" todo-forward-item t] ["Previous item" todo-backward-item t] "---" ["Save" todo-save t] ["Save Top Priorities" todo-save-top-priorities t] "---" ["Quit" todo-quit t]))
#@54 Major mode for editing TODO lists.

\{todo-mode-map}
(defalias 'todo-mode #[nil "\304\305\306\n!\210\307!\210\310\311!\207" [major-mode mode-name todo-mode-map todo-menu todo-mode "TODO" use-local-map easy-menu-add run-hooks todo-mode-hook] 2 (#$ . 18900) nil])
#@61 Make a diary entry appear only in the current date's diary.
(defalias 'todo-cp #[nil "\302 \232\205 	\207" [date entry calendar-current-date] 2 (#$ . 19171)])
(byte-code "\301B\303\301!\204 \304 \302B\303\302!\204 \305\306\307\"\310B\311\310\307\"\210\312\313\314\315#\207" [current-load-list todo-edit-mode-map todo-edit-mode-syntax-table boundp make-sparse-keymap make-char-table syntax-table nil todo-edit-mode-abbrev-table define-abbrev-table put todo-edit-mode derived-mode-parent text-mode] 4)
#@229 Major mode for editing items in the TODO list.

\{todo-edit-mode-map}

In addition to any hooks its parent mode `text-mode' might have run,
this mode runs the hook `todo-edit-mode-hook', as the final step
during initialization.
(defalias 'todo-edit-mode #[nil "\306 \210\306\307N\203 \310\311\307\312#\210\311\313\314\n!\204 \315\n\316 \"\210\317!\211\203. \f\320 =\2034 \321\322 \"\210)\203> \323\324\"\210\325\n!\210\326!\210\327\330!\207" [major-mode mode-name todo-edit-mode-map todo-edit-mode-syntax-table parent local-abbrev-table text-mode special put todo-edit-mode t "TODO Edit" keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table mapatoms #[(symbol) "\302\303!	\"\206 \304	\303!JK$\207" [symbol todo-edit-mode-abbrev-table intern-soft symbol-name define-abbrev] 5] use-local-map set-syntax-table run-hooks todo-edit-mode-hook todo-edit-mode-abbrev-table] 5 (#$ . 19690) nil])
#@17 Show TODO list.
(defalias 'todo-show #[nil "\303!\203 \304!\210\202 \305 \210	\2045 \n\204  \306\307\"\210\2025 eb\210\310\311\312\313#\203/ \314\315!\210\316\301!\210\n\317 \210\320 \207" [todo-file-do todo-categories todo-cats file-exists-p find-file todo-initial-setup error "Error in %s: No categories in list `todo-categories'" search-forward "todo-cats:" nil t replace-match "todo-categories:" make-local-variable beginning-of-line todo-category-select] 4 (#$ . 20673) nil])
#@46 Set up things to work properly in TODO mode.
(defalias 'todo-initial-setup #[nil "\301!\210\302 \210\303 \210\304\305!\207" [todo-file-do find-file erase-buffer todo-mode todo-add-category "Todo"] 2 (#$ . 21166)])
(provide 'todo-mode)
