* todo-mode.el: Clean up doc strings, comments and prompt strings,
[emacs.git] / lisp / calendar / ChangeLog
blobc5cf042abcc0692879cfc9cb9890c0d4be815f3a
1 2013-06-21  Stephen Berman  <stephen.berman@gmx.net>
3         * todo-mode.el: Clean up doc strings, comments and prompt strings,
4         mainly by changing "Todo" to "todo" when it is not part of a mode
5         name or does not begin a sentence.
7 2013-06-21  Stephen Berman  <stephen.berman@gmx.net>
9         * todo-mode.el: Offer to convert legacy file.  Update commentary.
10         (todo-show): If a legacy file is found and no new todo file
11         exists, offer to convert it and show it.  Restore autoload cookie.
12         (todo-convert-legacy-files): Delete unused local variable.
13         If todo-directory doesn't exist, create it before writing to file.
14         Check format of converted files.  Prompt to show converted todo file.
16 2013-06-19  Stephen Berman  <stephen.berman@gmx.net>
18         * todo-mode.el (todo-convert-legacy-files): Eliminate last change,
19         since it couldn't avoid namespace clashes, and instead let local
20         variables hold the legacy values used for conversion.  This also
21         does not interfere with live todo buffers.
23 2013-06-19  Stephen Berman  <stephen.berman@gmx.net>
25         * todo-mode.el: Rename from todos.el, change all occurrences of
26         "todos-" prefix to "todo-" and references to "Todos" to "Todo" or
27         "Todo mode".
29 2013-06-19  Stephen Berman  <stephen.berman@gmx.net>
31         * calendar/todo-mode.el: Rename to otodo-mode.el and move to obsolete/.
33 2013-06-19  Stephen Berman  <stephen.berman@gmx.net>
35         * todos.el (todos-convert-legacy-files): Add code to make it work
36         after the new version is renamed and has the same namespace as the
37         old version.  This also requires there to be no live todo buffers
38         when this command is called.
40 2013-06-18  Stephen Berman  <stephen.berman@gmx.net>
42         * todos.el: Reinstate current copyright dates and original
43         todo-mode.el author.  Add reference in commentary to legacy file
44         format conversion command.
45         (todos-legacy-date-time-regexp): Rename from
46         todos-todo-mode-date-time-regexp and adjust uses.
48 2013-06-18  Stephen Berman  <stephen.berman@gmx.net>
50         * todos.el (todos-diary-goto-entry): Add item locating code from
51         diary-goto-entry.  Add it at the top-level to override the latter
52         function.
53         (todos-powerset): Use definition by Wolfgang Jenkner, posted at
54         http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00423.html.
56         * diary-lib.el (diary-goto-entry-function): New variable.
57         (diary-entry): Use it in the action of this button type instead of
58         diary-goto-entry.
60 2013-06-09  Stephen Berman  <stephen.berman@gmx.net>
62         * todos.el (todos-edit-done-item-comment): Rename from
63         todos-done-item-add-edit-or-delete-comment.
64         (todos-key-bindings-t): Use it.
66 2013-06-09  Stephen Berman  <stephen.berman@gmx.net>
68         * todos.el: Fix and improve item date string editing.
69         (todos-date-pattern): Make dayname an explicitly numbered group.
70         (todos-basic-edit-item-header): Set match for dayname and use it
71         to ensure attempting to edit day, month or year of a date header
72         containing a day name is a noop, simplifying and fixing buggy code.
74 2013-06-08  Stephen Berman  <stephen.berman@gmx.net>
76         * todos.el: Improve commentary.
77         (todos-item-end): Revert last change, since bug#14565 is now fixed.
79 2013-06-07  Stephen Berman  <stephen.berman@gmx.net>
81         * todos.el: Reorganize file structure again, to pacify byte-compiler.
82         (todos-item-end): Use if-else instead of when-sexp to avoid
83         explicit nil argument of backward-char (bug#14565).
85 2013-06-06  Stephen Berman  <stephen.berman@gmx.net>
87         * todos.el: Fix more byte-compiler warnings.
88         (todos-jump-to-category): Let-bind variable that was mistakenly free.
89         (todos-toggle-item-highlighting, todos-convert-legacy-files):
90         Use eval-when-compile.
92 2013-06-05  Stephen Berman  <stephen.berman@gmx.net>
94         * todos.el: Fix byte-compiler warnings.
95         (todos-merge-category): Relocate let-bound variable.
96         (todos-toggle-item-highlighting): Restrict to todos-mode,
97         todos-archive-mode and todos-filtered-items-mode.
98         (todos-toggle-item-header, todos-diary-goto-entry)
99         (todos-insert-sort-button): Let-bind variables that were
100         mistakenly free.
101         (todos-convert-legacy-files): Just require todo-mode instead of
102         conditionalizing it.
103         (todos-modes-set-2): Check whether hl-line-range-function is void.
105 2013-06-05  Stephen Berman  <stephen.berman@gmx.net>
107         * todos.el: Further code cleanup.  Improve commentary.  Remove
108         autoload cookies.  Handle todo items in Fancy Diary display.
109         (todos-done-separator): Reinstate length one less than
110         window-width until bug#2749 is fixed.
111         (todos-diary-goto-entry): New function, extracted from adapted
112         definition of diary-goto-entry, which is removed to be added to
113         diary-lib.el.
114         (todos-powerset): Rename from todos-powerset-iterative and remove
115         defalias by this name.  Add doc string and comments.
116         (todos-modes-set-1, todos-modes-set-2, todos-modes-set-3)
117         (todos-mode-external-set): Add doc string.
119 2013-06-04  Stephen Berman  <stephen.berman@gmx.net>
121         * todos.el (todos-add-item-if-new-category): Change default value.
122         (todos-show, todos-jump-to-category, todos-add-file)
123         (todos-add-category): Update doc string to reflect new default
124         prompt for item insertion.
125         (todos-add-file): Add omitted argument to called-interactively-p.
126         (todos-show): Improve handling of adding first category.
128 2013-06-04  Stephen Berman  <stephen.berman@gmx.net>
130         * todos.el: Allow prompting for first item on adding a new
131         category.  Fix handling of default todo file on adding first file.
132         (todos-add-item-if-new-category): New defcustom.
133         (todos-show, todos-jump-to-category, todos-add-category): Use it.
134         (todos-short-file-name): Return nil if file name is not a string.
135         (todos-add-file): Recalculate todos-files after adding a file.
136         (todos-show): If first file was just added, make it the default.
138 2013-06-04  Stephen Berman  <stephen.berman@gmx.net>
140         * todos.el (todos-read-category, todos-merge-category):
141         Fix argument value to accord with documented change from 2013-05-14.
143 2013-06-03  Stephen Berman  <stephen.berman@gmx.net>
145         * todos.el: More code cleanup.  Update file copyright and author
146         lines, add commentary.  Reformat so most lines do not exceed 80
147         columns.  Fix doc strings problems found by checkdoc.
148         (todos-edit-file): Delete unused argument.
149         (todos-delete-item): Delete superfluous concat.
150         (todos-next-button, todos-previous-button): Delete optional
151         arguments, adjusting interactive spec accordingly, and add them as
152         non-nil arguments to the invocations of forward-button and
153         backward-button.
155 2013-06-03  Stephen Berman  <stephen.berman@gmx.net>
157         * todos.el (todos-y-with-space): New defcustom.
158         (todos-y-or-n-p): New function.
159         (todos-delete-category, todos-move-category, todos-delete-item)
160         (todos-done-item-add-edit-or-delete-comment, todos-item-undone)
161         (todos-find-archive, todos-archive-done-item, todos-search)
162         (todos-read-category): Use it instead of y-or-n-p.
164 2013-06-02  Stephen Berman  <stephen.berman@gmx.net>
166         * todos.el (todos-show-categories-table): Correct doc string.
167         (todos-sort-categories-alphabetically-or-numerically): Rename from
168         todos-sort-categories-alphabetically-or-by-priority and adjust uses.
169         (todos-set-category-number): Rename from
170         todos-set-category-priority and adjust uses.
171         (todos-raise-category): Rename from todos-raise-category-priority
172         and adjust uses.
173         (todos-lower-category): Rename from todos-lower-category-priority
174         and adjust uses.
176 2013-06-01  Stephen Berman  <stephen.berman@gmx.net>
178         * todos.el: Some custom cleanup.
179         (todos-edit): Rename from todos-item-insertion and adjust doc string.
180         (todos-display): Rename from todos-mode-display.
181         (todos-item-mark, todos-undo-item-omit-comment): Change :group to
182         todos-edit.
183         (todos-indent-to-here): Change :group to todos-display.
184         (todos, todos-edit, todos-categories, todos-filtered)
185         (todos-display, todos-faces): Change :version to "24.4".
187 2013-06-01  Stephen Berman  <stephen.berman@gmx.net>
189         * todos.el (todos-filtered-items-mode-map): Fix omission in
190         previous change.
191         (todos-mode): Comment out invocation of easy-menu-add, since menu
192         definition was commented out in last change.
194 2013-05-31  Stephen Berman  <stephen.berman@gmx.net>
196         * todos.el: Move auto-mode-alist entries above provide sexp.
197         Update adapted diary-goto-entry, so it also works with todo items
198         when the buffer in which the included todo file is processed for
199         the Fancy Diary is not killed.
200         (todos-insert-item-from-calendar): Move to item editing commands
201         section of file.  Add doc string, use todos-basic-insert-item and
202         remove mistaken invocation of todos-show.
204 2013-05-31  Stephen Berman  <stephen.berman@gmx.net>
206         * todos.el (todos-edit-quit): After editing an item, make sure to
207         return to its category.
209 2013-05-31  Stephen Berman  <stephen.berman@gmx.net>
211         * todos.el: Clean up code.  Uncapitalize file name in first line.
212         Require cl-lib instead of cl.  Add section title separators.
213         Reindent some code and comments.  Comment out Todos mode menu
214         definition.
215         (todos-basic-insert-item): Rename from todos-insert-item-1 and
216         adjust uses.
217         (todos-basic-edit-item-header): Rename from
218         todos-edit-item-header-1 and adjust uses.
219         (todos-display-categories): Rename from todos-display-categories-1
220         and adjust uses.
221         (todos-show, todos-basic-insert-item)
222         (todos-basic-edit-item-header, todos-set-item-priority)
223         (todos-item-undone, todos-convert-legacy-files)
224         (todos-check-format, todos-filter-items-1):
225         Use user-error instead of error.
226         (todos-add-file, todos-basic-insert-item, todos-mark)
227         (todos-button, todos-sorted-column, todos-archived-only)
228         (todos-search, todos-category-string)
229         (todos-top-priorities-overrides)
230         (todos-insertion-commands-args-genlist, todos-filter-items)
231         (todos-filter-items-1, todos-filtered-items-mode-map):
232         Correct or improve document string.
233         (todos-edit-file)
234         (todos-sort-categories-alphabetically-or-by-priority)
235         (todos-sort-categories-by-todo, todos-sort-categories-by-diary)
236         (todos-sort-categories-by-done)
237         (todos-sort-categories-by-archived, todos-next-button)
238         (todos-previous-button, todos-gen-arglists)
239         (todos-define-insertion-command)
240         (todos-insertion-commands-arg-key-list)
241         (todos-insertion-key-bindings, todos-update-categories-display):
242         Add document string.
243         (todos-powerset-recursive): Rename from powerset-recursive and
244         reformulate slightly.
245         (todos-powerset-iterative): Rename from powerset-bitwise and
246         reformulate.
247         (todos-insertion-commands-args): Use cl-remove-duplicates instead
248         of remove-duplicates.
249         (todos-define-insertion-command): Improve doc string of generated defun.
250         (todos-adjusted-category-label-length)
251         (todos-insert-category-line, todos-update-categories-display):
252         Call cl-oddp instead of inlining its definition.
253         (todos-key-bindings): Remove, replacing by the following.
254         (todos-key-bindings-t, todos-key-bindings-t+a+f)
255         (todos-key-bindings-t+a, todos-key-bindings-t+f): New variables.
256         (todos-mode-map): Use new key-binding variables.
257         (todos-archive-mode-map, todos-filtered-items-mode-map): Use new
258         key-binding variables.  Don't suppress digit keys.
259         (todos-categories-mode-map): Don't suppress digit keys.
260         (todos-modes-set-1, todos-modes-set-2, todos-modes-set-3)
261         (todos-mode, todos-archive-mode, todos-mode-external-set):
262         Use setq-local instead of make-local-variable.
264 2013-05-24  Stephen Berman  <stephen.berman@gmx.net>
266         * todos.el: Reorganize file structure.
268 2013-05-22  Stephen Berman  <stephen.berman@gmx.net>
270         * todos.el (todos-edit-quit): Don't allow dateless item.
272 2013-05-21  Stephen Berman  <stephen.berman@gmx.net>
274         * todos.el (todos-key-bindings, todos-archive-mode-map)
275         (todos-filtered-items-mode-map): Update bindings.
276         (todos-find-archive): Rename from todos-show-archive and adjust uses.
277         (todos-find-filtered-items-file): New command.
279 2013-05-21  Stephen Berman  <stephen.berman@gmx.net>
281         * todos.el: Use visual-line-mode instead of custom code.
282         (todos-line-wrapping-function, todos-wrap-and-indent): Remove.
283         (todos-wrap-lines, todos-indent-to-here): Update doc string.
284         (todos-modes-set-1): Use visual-line-mode.
286 2013-05-21  Stephen Berman  <stephen.berman@gmx.net>
288         * todos.el (todos-read-file-name): Fix previous change to ensure
289         it works when invoked outside of a Todos file.
291 2013-05-20  Stephen Berman  <stephen.berman@gmx.net>
293         * todos.el: Fixes concerning filtered items.
294         (todos-mode-line-control): Make doc string more precise.
295         (todos-read-file-name): Default to current file when user hits RET
296         without choosing a file, to avoid creating file with empty base name.
297         (todos-filter-items): Rename buffer of filtered items files.
298         (todos-find-item): Save match data to avoid arg out of range error.
299         (todos-print-buffer): Fix header of filtered items buffer output.
301 2013-05-17  Stephen Berman  <stephen.berman@gmx.net>
303         * todos.el (todos-done-separator): Use window-width for length, in
304         anticipation of bug#2749 being fixed.
306 2013-05-17  Stephen Berman  <stephen.berman@gmx.net>
308         * todos.el (todos-category-completions): Restore point after
309         ensuring category is properly displayed.
311 2013-05-16  Stephen Berman  <stephen.berman@gmx.net>
313         * todos.el (todos-filtered-items-mode-map): Update some bindings.
314         (todos-show): Make it work the same in todos-archive-mode and
315         todos-filtered-items-mode as in todos-mode.
316         (todos-quit): When called in todos-archive-mode, switch to
317         corresponding category in todo file.  When called in todos-mode,
318         avoid going right back to archive.
320 2013-05-16  Stephen Berman  <stephen.berman@gmx.net>
322         * todos.el: Improve toggling of item numbering and headers.
323         (todos-prefix-overlays): Don't reset item numbering for
324         done items unless in todos-mode.
325         (todos-archive-mode-map): Add bindings for todos-toggle-item-header.
326         (todos-toggle-prefix-numbers): Reimplement without using
327         todos-reset-prefix and make it work in Todos Archive mode and
328         Todos Filtered Items mode.
329         (todos-toggle-item-header): Make it work in Todos Archive mode and
330         Todos Filtered Items mode.
332 2013-05-15  Stephen Berman  <stephen.berman@gmx.net>
334         * todos.el: Use tab instead of spaces to indent.
335         (todos-indent-to-here): Change default value.
336         (todos-modes-set-1): Make tab-width a local variable and set it to
337         todos-indent-to-here.
338         (todos-insert-item-1, todos-edit-item): Use tab not spaces to indent.
339         (todos-edit-quit): Use tab not spaces to indent and fix omission of item.
341 2013-05-15  Stephen Berman  <stephen.berman@gmx.net>
343         * todos.el (todos-jump-to-category): Fix wrong variable left over
344         from previous change.
346 2013-05-14  Stephen Berman  <stephen.berman@gmx.net>
348         * todos.el: Improve handling of jumping to a category, in
349         particular that of an archive.
350         (todos-category-completions): Add optional parameter to restrict
351         completions of archive categories to current archive.  Exclude
352         archive from completion files.
353         (todos-read-category): When called from an archive, restrict
354         category completions to the archive.  Fix mistaken use of all
355         completion files instead of just those in which the chosen
356         category occurs.
357         (todos-archive-mode-map): Add new key binding.
358         (todos-jump-to-category): Rename second optional parameter and
359         extend its use to restricting category completions to the current
360         archive.
361         (todos-jump-to-archive-category): New command.
363 2013-05-13  Stephen Berman  <stephen.berman@gmx.net>
365         * todos.el (todos-modes-set-2): Restore point after finding start
366         and end of hl-line-range-function.
368 2013-05-13  Stephen Berman  <stephen.berman@gmx.net>
370         * todos.el: Fixes for item marking and marked items.
371         (todos-toggle-mark-item): Make no-op if point is not on an item.
372         Toggle mark even if point is not at start of item.
373         (todos-item-done): Signal an error if a done item is marked.
374         Process marked todo items even if point is in done items section.
376 2013-05-11  Stephen Berman  <stephen.berman@gmx.net>
378         * todos.el (todos-item-undone): Remove item highlighting when user
379         quits before deciding whether to omit comment.  Fix misplaced
380         closing paren.  Change two uses of `if' to `when'.
382 2013-05-10  Stephen Berman  <stephen.berman@gmx.net>
384         * todos.el: Rename numerous commands and defcustoms and adjust all
385         uses, change numerous key bindings, make some basic commands
386         noninteractive and use them to define the commands, unify
387         archiving commands.
388         (todos-directory): Rename from todos-files-directory.
389         (todos-print-buffer-function): Rename from todos-print-function.
390         (todos-number-prefix): Rename from todos-number-priorities.
391         (todos-top-priorities-overrides): Rename from todos-priorities-rules.
392         (todos-top-priorities): Rename from todos-show-priorities.
393         (todos-insertion-command-name, todos-insertion-key-bindings):
394         Use "todos-insert-item-".
395         (todos-key-bindings, todos-archive-mode-map)
396         (todos-categories-mode-map, todos-filtered-items-mode-map):
397         Adjust to renamed commands, make bindings more systematic,
398         reorder entries.
399         (todos-show-categories-table): Rename from todos-display-categories.
400         (todos-sort-categories-alphabetically-or-by-priority): Rename from
401         todos-display-categories-alphabetically-or-by-priority.
402         (todos-sort-categories-by-todo): Rename from
403         todos-display-categories-sorted-by-todo.
404         (todos-sort-categories-by-diary): Rename from
405         todos-display-categories-sorted-by-diary.
406         (todos-sort-categories-by-done): Rename from
407         todos-display-categories-sorted-by-done.
408         (todos-sort-categories-by-archived): Rename from
409         todos-display-categories-sorted-by-archived.
410         (todos-print-buffer): Rename function from todos-print.
411         (todos-print-buffer-to-file): Rename from todos-print-to-file.
412         (todos-go-to-source-item): Rename from todos-jump-to-item.
413         (todos-forward-item, todos-backward-item): Remove interactive form
414         and move most of doc string and prefix argument error checking to...
415         (todos-next-item, todos-previous-item): ...these new commands,
416         which use the preceding functions.
417         (todos-next-button): Rename from todos-forward-button.
418         (todos-previous-button): Rename from todos-backward-button.
419         (todos-toggle-prefix-numbers): Rename from
420         todos-hide-show-item-numbering.
421         (todos-toggle-view-done-items): Rename from todos-hide-show-done-items.
422         (todos-toggle-view-done-only): Rename from todos-show-done-only.
423         (todos-toggle-item-highlighting): Rename from todos-highlight-item.
424         (todos-toggle-item-header): Rename from todos-hide-show-date-time.
425         (todos-toggle-mark-item): Rename from todos-mark-unmark-item.
426         (todos-filter-top-priorities): Rename from todos-top-priorities.
427         (todos-filter-top-priorities-multifile): Rename from
428         todos-top-priorities-multifile.
429         (todos-filter-diary-items): Rename from todos-diary-items.
430         (todos-filter-diary-items-multifile): Rename from
431         todos-diary-items-multifile.
432         (todos-filter-regexp-items): Rename from todos-regexp-items.
433         (todos-filter-regexp-items-multifile): Rename from
434         todos-regexp-items-multifile.
435         (todos-insert-item-1): Remove interactive form, since
436         todos-insert-item is generated like other item insertion commands.
437         (todos-edit-file): Rename from todos-edit-multiline.
438         (todos-item-undone): Rename from todos-item-undo.
439         (todos-archive-done-item): Add raw prefix spec to interactive form
440         and use it to test for archiving all done items in category;
441         reorder tests in function body accordingly.
442         (todos-archive-category-done-items): Remove.
444 2013-04-27  Stephen Berman  <stephen.berman@gmx.net>
446         * todos.el (todos-edit-multiline-item): Make a no-op when point is
447         not on an item.
449 2013-04-24  Stephen Berman  <stephen.berman@gmx.net>
451         * todos.el (todos-check-format): Add check of well-formedness of
452         categories sexp.  If it is well-formed but differs from
453         todos-categories, do not signal an error but display a message.
455 2013-04-21  Stephen Berman  <stephen.berman@gmx.net>
457         * todos.el: Fixes and improvements related to item relocation.
458         (todos-category-completions): On ensuring proper category display,
459         if done items in category are visible, keep them visible.
460         (todos-set-item-priority): Keep top of category in view while
461         setting priority.
462         (todos-move-item): Restore prevention of moving within the same
463         category.  Move done items to top, not end, of done items section.
464         When user quits before setting priority, make sure to return to
465         starting file.
466         (todos-item-undo): Partly reimplement along lines of
467         todos-move-item, adding highlighting of single item as undo
468         target, setting priority of multiple undone items, improving
469         handling of quitting before setting priority.
470         (todos-unarchive-items): Restore items to top, not end, of
471         category's done section.
473 2013-04-19  Stephen Berman  <stephen.berman@gmx.net>
475         * todos.el: Extend and improve item filtering and handling of
476         saved files of filtered items.
477         (todos-show-first): Add choices for diary and regexp items.
478         (todos-absolute-file-name): Handle file names for diary and regexp
479         items.
480         (todos-filter-items): New function abstracted from item filtering
481         commands, with handling of saved files of diary and regexp items.
482         (todos-filter-items-1): Rename from todos-filter-items.
483         (todos-filtered-buffer-name): Remove, since functionality is now
484         incorporated into new function todos-filter-items.
485         (todos-filtered-items-buffer, todos-top-priorities-buffer)
486         (todos-diary-items-buffer, todos-regexp-items-buffer):
487         Make defconsts instead of defcustoms.
488         (todos-find-item): Restrict calculation and comparison of
489         priorities to top priority items, in order to handle diary and
490         regexp items.
491         (todos-check-filtered-items-file): Rename from
492         todos-check-top-priorities and adjust message and callers.
493         (todos-filter-items-filename): Rename from
494         todos-top-priorities-filename, adjusting caller and extending to
495         files of filtered diary and regexp items.
496         (todos-save-filtered-items-buffer): Rename from
497         todos-save-top-priorities-buffer and adjust caller and uses.  Use
498         write-file instead of write-region and use existing file name if
499         previously saved.
500         (todos-show): Handle initially displaying saved file of filtered
501         diary or regexp items.
502         (todos-top-priorities, todos-top-priorities-multifile)
503         (todos-diary-items, todos-diary-items-multifile)
504         (todos-regexp-items, todos-regexp-items-multifile): Use new
505         function todos-filter-items.
506         (auto-mode-alist): Extend regexp for files assigned to
507         todos-filtered-items-mode to handle saved diary and regexp items.
509 2013-03-17  Stephen Berman  <stephen.berman@gmx.net>
511         * calendar/todos.el (todos-insert-item): Fix mistake in logic of
512         here insertion from last change, and ensure category is set when
513         command is called from outside Todos buffer.
515 2013-03-15  Stephen Berman  <stephen.berman@gmx.net>
517         * calendar/todos.el: Item unarchiving fixes and improvements.
518         (todos-archive-mode-map): Add bindings for item and category
519         marking/unmarking; make todos-display-categories binding same as
520         in Todos mode; remove todos-unarchive-category binding.
521         (todos-unarchive-category): Remove.
522         (todos-unarchive-items): Fix handling of marked items.  Remove
523         code for unarchiving whole category, since that is covered by
524         unarchiving marked items.  Handle unarchiving items to a category
525         that had been deleted from the todo file by re-adding the
526         category.  Use todos-category-select to display restored items,
527         not todos-show.  Remove obsolete or superfluous code.
529 2013-03-15  Stephen Berman  <stephen.berman@gmx.net>
531         * calendar/todos.el (todos-reset-prefix): Don't remove overlays,
532         since it's superfluous and also wrongly removes items marks.
533         (todos-category-completions): Select current category on visiting
534         file, to ensure category is properly displayed if user switches to
535         file via a non-Todos command.
536         (todos-mark-category): Make implementation cleaner.
537         (todos-unmark-category): Improve implementation.  Get overlay
538         property only when there is an overlay.
540 2013-03-14  Stephen Berman  <stephen.berman@gmx.net>
542         * calendar/todos.el (todos-insert-item): Fix last change to make
543         sure calling insertion "here" from outside goal todo items section
544         gives new item top priority.  With priority insertion, if user
545         cancels before setting priority, restore display.
546         (todos-find-item): Restore narrowing after searching.
547         (todos-item-done): Allow adding (same) comment to marked items.
548         Don't add empty comment to done item.
550 2013-03-13  Stephen Berman  <stephen.berman@gmx.net>
552         * calendar/todos.el (todos-quit): If quitting
553         todos-filtered-items-mode makes todos-mode current, don't call
554         todos-show, which (here wrongly) prompts for a new Todos file.
555         (todos-delete-category): Fix incorrect quotation mark.
556         (todos-set-item-priority): Make prefix argument a no-op with
557         commands for raising or lowering item priority.  Move mistakenly
558         placed right paren to end of defun, where it belongs.
560 2013-02-25  Stephen Berman  <stephen.berman@gmx.net>
562         * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'.
563         (todos-show): Prompt for which todo file to visit when invoked
564         from Todos mode.
566 2013-02-19  Stephen Berman  <stephen.berman@gmx.net>
568         * calendar/todos.el: Item insertion and done/undo fixes.
569         (todos-insert-item): Maybe set the insertion file to
570         todos-global-current-todos-file.  When inserting into a file that
571         was not being visited on invoking this command, ensure chosen
572         category is properly selected.  Make item inserted "here" the
573         first todo item if the command was invoked with point in done
574         items section or outside of the current category.
575         (todos-item-done): When done items are shown, put cursor on first
576         just done item.
577         (todos-item-undo): Put cursor on undone item.
579 2013-02-16  Stephen Berman  <stephen.berman@gmx.net>
581         * calendar/todos.el: Improve handling of overlays.
582         (todos-get-overlay): New function.
583         (todos-prefix-overlay): Remove, since subsumed by
584         todos-get-overlay, and replace by the latter in callers.
585         (todos-reset-prefix): Apply only to buffer visiting Todos files.
586         Simplify implementation and use `todos' overlay property.
587         (todos-reset-done-separator): Use todos-get-overlay and `todos'
588         overlay property.  Fix logic.
589         (todos-category-select): Use todos-get-overlay and `todos' overlay
590         property.
591         (todos-remove-item): Use todos-get-overlay.  Correct obsolete code.
592         (todos-prefix-overlays): Use todos-top-priority face also for
593         non-numerical prefix of top priority items.  Add `todos' overlay
594         property.
595         (todos-hide-show-date-time): Simplify, using todos-get-overlay and
596         `todos' overlay property.
598 2013-02-14  Stephen Berman  <stephen.berman@gmx.net>
600         * calendar/todos.el (todos-edit-multiline, todos-edit-quit):
601         Revert buffer renaming.
603 2013-02-11  Stephen Berman  <stephen.berman@gmx.net>
605         * calendar/todos.el (todos-edit-quit): On quitting file editing,
606         rename buffer back to current Todos file.  After selecting
607         category, put point at top instead of recentering.
609 2013-02-08  Stephen Berman  <stephen.berman@gmx.net>
611         * calendar/todos.el (todos-edit-multiline-item): Revert to using
612         indirect buffer, which makes it easier to return to Todos mode.
613         (todos-edit-quit): Don't delete and reinsert items that don't need
614         indenting.  Revert to just killing buffer on quitting single item
615         editing.  On quitting file editing, select nearest category.
617 2013-02-07  Stephen Berman  <stephen.berman@gmx.net>
619         * calendar/todos.el: Bug fixes and improvements to item editing
620         and insertion.
621         (todos-check-format): Compare current value of todos-categories
622         with actual categories sexp.
623         (todos-repair-categories-sexp): Add warning to doc string about
624         category order getting restored to list element order.
625         (todos-mode-external-set): When todos-categories is nil, as in
626         Todos Edit mode, set it by reading actual categories sexp.
627         (todos-edit-mode): Make buffer writeable.
628         (todos-done-item-section-p): New function.
629         (todos-insert-item): Use it as part of preventing insertion here
630         in done items section.  Move check for display of done items only
631         to just before setting new item's priority, and if cancelled after
632         toggling to todo items, restore display of done items.
633         (todos-edit-multiline-item): Don't base on todos-edit-multiline
634         but just narrow and change mode.
635         (todos-edit-multiline): Don't make indirect buffer but just widen
636         and change mode; also remove overlays.
637         (todos-edit-quit): Restore Todos mode and category display; when
638         quitting multiline item editing, ensure items above edited item
639         are visible in window if possible.
640         (todos-done-item-add-edit-or-delete-comment): If user moved point
641         during editing, make sure it moves back to edited item before
642         returning.
644 2013-02-05  Stephen Berman  <stephen.berman@gmx.net>
646         * calendar/todos.el (todos-reset-done-separator-string):
647         Complete the implementation.
648         (todos-hide-show-done-items): If start of done items sections is
649         below the bottom of the window, make it visible.
650         (todos-insert-item): Allow inserting item here to work outside of
651         the current category, but then at top of category.  After checking
652         whether only done items are shown, restore point to ensure
653         inserting item here works correctly.
654         (todos-set-item-priority): Delete leftover right paren at end.
656 2013-02-04  Stephen Berman  <stephen.berman@gmx.net>
658         * calendar/todos.el: Bug fixes involving or displaying done items.
659         (todos-done-separator): Make length of long separator one less
660         than window-width, in order to avoid following empty line.
661         (todos-forward-item, todos-backward-item): Make empty line below
662         last todo item accessible only by invoking without a numerical
663         prefix argument and make the latter invocations move only to items.
664         (todos-insert-item): Set todos-current-todos-file after selecting
665         buffer, in order not to set global value.  If only done items are
666         shown when this command is invoked, toggle to show todo items to
667         avoid insertion into done items section.  When done items are
668         shown, protect from cancelling before setting item priority: this
669         also needs recentering to display all items.
670         (todos-set-item-priority): Only call on (not done) todo items.
671         Check that done items are visible not because file is widened.
672         Use only `any' argument of called-interactively-p.  Make sure that
673         giving an undone item lowest priority restores it to the todo
674         section.
675         (todos-item-done): If done items are visible on invoking this
676         command, keep them visible afterwards.  Stop looking for marked
677         items on reaching the empty line below the last todo item.
679 2013-02-02  Stephen Berman  <stephen.berman@gmx.net>
681         * calendar/todos.el: Several small fixes and improvements.
682         (todos-done-separator-string): Change default value.
683         (todos-update-categories-sexp): Remove unnecessary and misquided
684         setq of todos-default-todos-file.  Use delete-region instead of
685         kill-region to avoid polluting kill-ring.
686         (todos-unload-hook): Remove (was not used).
687         (todos-edit-multiline): Don't generate new edit buffer name on
688         each invocation---that can cause confusion due to indirect buffer.
689         (todos-edit-quit): Ensure lines in edit buffer that follow hard
690         newlines are indented in the file to conform to diary format.
691         (todos-set-item-priority): If done items in category are visible,
692         keep them visible.
694 2013-01-30  Stephen Berman  <stephen.berman@gmx.net>
696         * calendar/todos.el: Fix done separator overlay bug.  Remove most
697         FIXME comments.
698         (todos-reset-and-enable-done-separator): Remove commented out
699         workaround for done separator overlay bug; fix doc string.
700         (todos-reset-done-separator): Delete old overlay after adding new
701         overlay to fix done separator overlay bug; improve implementation.
702         (todos-prefix-overlays): Improve first line of doc string.
704 2013-01-29  Stephen Berman  <stephen.berman@gmx.net>
706         * calendar/todos.el: Improve item marking and handling of marked items.
707         (todos-prefix): Add validator to ensure value differs from that of
708         todos-item-mark.
709         (todos-item-mark): New defcustom.
710         (todos-prefix-overlay): New function.
711         (todos-marked-item-p): Use it.  Adapt implementation to new
712         handling of marked items.
713         (todos-insert-with-overlays): When inserting pushes down a marked
714         item, move its prefix overlay.
715         (todos-prefix-overlays): Add overlay even when prefix is empty string,
716         otherwise item marking fails.  Improve handling of marked items.
717         (todos-mark-unmark-item): Adapt to new handling of marked items
718         and simplify by removing marking of all items in category.
719         (todos-mark-category): Adapt to new handling of marked items and
720         don't use todos-mark-unmark-item.
721         (todos-unmark-category): Adapt to new handling of marked items.
722         (todos-delete-item): Remove obsolete handling of marked items and
723         useless restoration of point.
724         (todos-set-item-priority): Use new handling of marked items.
725         (todos-move-item, todos-item-done, todos-item-undo)
726         (todos-archive-done-item): Remove obsolete handling of marked items.
728 2013-01-25  Stephen Berman  <stephen.berman@gmx.net>
730         * calendar/todos.el: Improve definitions and use of some faces.
731         (todos-top-priority): Use current definition of font-lock-constant-face.
732         (todos-diary-expired): Make default value contrast more with
733         default value of todos-date face.
734         (todos-nondiary, todos-category-string): New faces.
735         (todos-nondiary-face, todos-category-string-face): Corresponding
736         new variables.
737         (todos-done, todos-comment): Switch default values to go better
738         with default value of todos-date face.
739         (todos-done-sep): Change default value.
740         (todos-category-string-matcher-1)
741         (todos-category-string-matcher-2): Improve doc string.
742         (todos-font-lock-keywords): Use todos-nondiary-face and
743         todos-category-string-face.
744         (todos-done-separator): Propertize string with todos-done-sep face.
745         (todos-filtered-items-mode): Fix typo.
747 2013-01-23  Stephen Berman  <stephen.berman@gmx.net>
749         * calendar/todos.el: Improve handling of saved top priorities items.
750         (todos-find-item): Find done items and items whose priority has
751         changed or whose text was truncated or augmented; add doc string.
752         (todos-check-top-priorities): Highlight each item that is not up
753         to date.
754         (todos-jump-to-item): Jump to items whose priority has changed or
755         whose text was truncated or augmented.
757 2013-01-22  Stephen Berman  <stephen.berman@gmx.net>
759         * calendar/todos.el: Revise handling of initial display and extend
760         to top priorities file.
761         (todos-display-categories-first): Remove, replacing by this:
762         (todos-show-first): New defcustom.
763         (todos-first-visit): Remove, replacing by this:
764         (todos-visited): New variable.
765         (todos-absolute-file-name): Extend possible values of optional
766         argument to take top priorities files into account.
767         (todos-modes-set-3, todos-mode): Remove use of todos-first-visit.
768         (todos-mode-external-set): Call find-file-noselect instead of
769         find-buffer-visiting, since the latter may fail.
770         (todos-show): Revise handling of initial display using
771         todos-show-first and todos-visited and extend to top priorities
772         file.
773         (todos-quit): Adapt to new handling of initial display.
775 2013-01-14  Stephen Berman  <stephen.berman@gmx.net>
777         * calendar/todos.el: Implement saving top priority items buffers,
778         improve implementation of item filtering commands and
779         infrastucture, and fix two bugs.
780         (todos-prefix-overlays): Use todos-top-priority face only in Todos
781         mode.
782         (todos-multiple-filter-files): Get file-truename of Todos file.
783         (todos-filter-items): Pass a list of files from the caller instead
784         of building it here, and move handling of cancelled file selection
785         dialog to callers.  Correct omission of file-wide default number
786         of top priorities.
787         (todos-filtered-buffer-name): Treat file-list argument only as a list.
788         (todos-find-item, todos-check-top-priorities)
789         (todos-top-priorities-filename)
790         (todos-save-top-priorities-buffer): New functions.
791         (todos-save): Use todos-save-top-priorities-buffer.
792         (todos-jump-to-item): Refactor and use todos-find-item.
793         (todos-top-priorities): Simplify semantics of prefix argument.
794         Check if top priorities file exists and if so, visit it, reporting
795         whether it is up to date.  Add optional argument and use it to
796         handle multiple files.
797         (todos-diary-items, todos-regexp-items): Add optional argument and
798         use it to handle multiple files.
799         (todos-top-priorities-multifile, todos-diary-items-multifile)
800         (todos-regexp-items-multifile): Refactor, using corresponding
801         non-multifile command.
802         (auto-mode-alist): Add pattern for top priorities files to visit
803         these in Todos Filtered Items mode.
805 2013-01-08  Stephen Berman  <stephen.berman@gmx.net>
807         * calendar/todos.el: Fix tabular alignment in Todos Categories mode.
808         (todos-adjusted-category-label-length): New function.
809         (todos-padded-string): Use it.
811 2013-01-08  Stephen Berman  <stephen.berman@gmx.net>
813         * calendar/todos.el (todos-move-item): Allow moving done items to
814         done section of another category.
816 2013-01-06  Stephen Berman  <stephen.berman@gmx.net>
818         * calendar/todos.el: Display numerical priority string of top
819         priority items in category in a distinctive face.
820         (todos-prefix-string): Make doc string more precise.
821         (todos-top-priority): New defface.
822         (todos-done, todos-done-sep): Use more compact face definition
823         \(taken from font-lock.el).
824         (todos-comment): Give a complete face definition, instead of
825         inheriting from todos-done.
826         (todos-font-lock-keywords): Use todos-comment-face for
827         todos-comment-string-matcher.
828         (todos-prefix-overlays): Use todos-top-priority as the face
829         property of top priority items; don't condition reapplying item
830         prefix overlay on whether the string changed, since that prevents
831         updating display after changing number of top priorities.
832         (todos-set-top-priorities): Call todos-prefix-overlays to update
833         display.
835 2013-01-04  Stephen Berman  <Stephen.Berman@rub.de>
837         * calendar/todos.el (todos-reset-global-current-todos-file)
838         (todos-display-categories-1): Use absolute name of
839         todos-default-todos-file.
841 2013-01-04  Stephen Berman  <Stephen.Berman@rub.de>
843         * calendar/todos.el (todos-insert-item): Fix copy and paste error
844         from previous change.
846 2013-01-03  Stephen Berman  <stephen.berman@gmx.net>
848         * calendar/todos.el: Implement extended category completions.
849         (todos-default-todos-file): Change default value to correct custom
850         type.
851         (todos-category-completions-files): New defcustom.
852         (todos-reevaluate-category-completions-files-defcustom)
853         (todos-absolute-file-name, todos-category-completions): New defuns.
854         (todos-reevaluate-filelist-defcustoms):
855         Add todos-category-completions-files and
856         todos-reevaluate-category-completions-files-defcustom.
857         (todos-allcats-file, todos-all-categories-alist)
858         (todos-jump-to-category-other-file, todos-jump-to-any-category)
859         (todos-move-item-to-file): Remove (todos-all-categories-alist both
860         as defvar and as defun).
861         (todos-read-category): Rewrite using extended category completions
862         and better handling of completion against existing or non-existing
863         categories.
864         (todos-validate-name): Correct doc string; use local instead of
865         dynamic variables in function body.
866         (todos-insert-category-line): Adjust use of todos-jump-to-category
867         to new argument list.
868         (todos-key-bindings, todos-menu): Delete entries for removed
869         commands.
870         (todos-show): Get absolute name of todos-default-todos-file;
871         add `nowarn' argument to find-file-noselect; adjust use of
872         todos-add-category to new argument list.
873         (todos-jump-to-category): Rewrite using extended category
874         completions; reverse argument list, adapting FILE argument to new
875         completion mechanism; add autoload cookie; call todos-show if
876         there are no Todos files.
877         (todos-add-category): Rewrite using extended category completions;
878         add FILE argument to accommodate new completion mechanism.
879         (todos-merge-category): Adapt to extended category completions,
880         adding prefix argument.
881         (todos-insert-item): Adapt to extended category completions; use
882         todos-read-category instead of todos-jump-to-category in prefix
883         argument calls; call todos-show if there are no Todos files; if
884         item is inserted at end of category, recenter to ensure the items
885         above it are displayed in the window.
886         (todos-move-item): Adapt to extended category completions, making
887         argument prefix argument; allow moving within category (for the
888         sake of code simplification); add `nowarn' argument to
889         find-file-noselect.
890         (todos-archive-done-item): Prevent error when attempting to
891         archive not-done todo item; adjust use of todos-add-category to
892         new argument list.
894 2012-12-15  Stephen Berman  <stephen.berman@gmx.net>
896         * calendar/todos.el (todos-archive-done-item): Fix archiving of
897         all done items in a category and resulting display of todo file.
899 2012-12-14  Stephen Berman  <stephen.berman@gmx.net>
901         * calendar/todos.el (todos-priorities-rules): Fix customization
902         type to prevent mismatch error.
903         (todos-set-top-priorities): Fix rule construction; fix input check;
904         improve prompt.
906 2012-12-14  Stephen Berman  <stephen.berman@gmx.net>
908         * calendar/todos.el (todos-insert-item): If user exits Calendar
909         before choosing a date, cancel item insertion.
910         (todos-set-date-from-calendar): If user exits Calendar before
911         choosing a date, clean up properly.
913 2012-12-12  Stephen Berman  <stephen.berman@gmx.net>
915         * calendar/todos.el: Extend and improve handling of item editing,
916         especially of date/time header.
917         (todos-month-name-array, todos-month-abbrev-array): New defconsts.
918         (todos-date-pattern): Use explicitly numbered groups.
919         (todos-read-date): Optionally read and return just one of the date
920         string components year, month or monthname, day.
921         (todos-key-bindings): Add bindings for new item header editing
922         commands.
923         (todos-edit-item): Exclude date/time header from minibuffer by
924         default; include it by passing a prefix argument.
925         (todos-edit-item-header-1): New function containing the guts of
926         the commands for editing item date/time headers.
927         (todos-edit-item-header): Use it.  Condition editing of time
928         string on value of `todos-always-add-time-string'.
929         (todos-edit-item-date-from-calendar): Use todos-edit-item-header-1.
930         (todos-edit-item-date-to-today): Rename from
931         todos-edit-item-date-is-today and use todos-edit-item-header-1.
932         (todos-edit-item-date): Remove.
933         (todos-edit-item-date-day-name, todos-edit-item-date-year)
934         (todos-edit-item-date-month, todos-edit-item-date-day): New commands.
936 2012-12-02  Stephen Berman  <stephen.berman@gmx.net>
938         * calendar/todos.el (todos-show): Fix a comment.
939         (todos-add-category): Prompt for a new category if passed category
940         is the empty string, not nil.
942 2012-11-26  Stephen Berman  <stephen.berman@gmx.net>
944         * calendar/todos.el (todos-make-categories-list)
945         (todos-convert-legacy-files, todos-jump-to-item)
946         (todos-move-category, todos-merge-category)
947         (todos-archive-done-item, todos-unarchive-items): Include end of
948         line in regex searches for beginning of category, in order not to
949         get a category whose name contains the searched for category name.
951 2012-11-15  Stephen Berman  <stephen.berman@gmx.net>
953         * calendar/todos.el (todos-forward-category): Fix typo.
955 2012-10-30  Stephen Berman  <stephen.berman@gmx.net>
957         * calendar/todos.el (todos-define-insertion-command):
958         Let generated insertion commands accept a prefix argument.
960 2012-10-08  Stephen Berman  <Stephen.Berman@rub.de>
962         * calendar/todos.el (todos-move-item): If user quits before
963         completing movement, restore display of initial category; if item
964         is moved to end of target category, make sure the items above it
965         are displayed in the window.
967 2012-10-08  Stephen Berman  <stephen.berman@gmx.net>
969         * calendar/todos.el: Fixes to todos-move-item and some of its
970         subroutines.
971         (todos-move-item): When there are marked items, point need not be
972         on an item; remove obsolete use of todos-add-category, since this
973         is now already done in todos-read-category; fix typo.
974         (todos-diary-item-p): Exclude empty lines.
975         (todos-read-category): Restore point and narrowing after adding
976         new category, to avoid moving to beginning of file when moving
977         marked items to a new category.
978         (todos-set-item-priority): Prompt for priority only when the
979         category has at least one todo item; only use non-nil priority to
980         calculate insertion location.
981         (todos-read-category): Don't reset todos-categories when a new
982         category is added due to todos-move-item or todos-jump-to-item.
984 2012-09-24  Stephen Berman  <stephen.berman@gmx.net>
986         Changes from 2012-07-14 (revision 110020).
987         * calendar/todos.el (todos-copy-item): New command.
988         (todos-insertion-map): Add key binding for it.
990 2012-09-24  Stephen Berman  <stephen.berman@gmx.net>
992         Changes from 2012-07-13 (revision 110019).
993         * calendar/todos.el (todos-undo-item-omit-comment): New defcustom.
994         (todos-item-undo): Use it.
995         (todos-allcats-file, todos-all-categories-alist): New variables.
996         (todos-all-categories-alist): New function.
997         (todos-jump-to-any-category): New command.
998         (todos-move-item): Remove mark overlays from buffer items were
999         moved from; update todos-categories-with-marks,
1001 2012-09-24  Stephen Berman  <stephen.berman@gmx.net>
1003         Changes from 2012-06-27 (revision 110018).
1004         * calendar/todos.el: Further code rearrangement; further new and
1005         revised comments.
1006         (todos-reevaluate-filelist-defcustoms): Rename from
1007         todos-reevaluate-defcustoms and adjust callers.
1008         (todos-date-pattern, todos-nondiary-start, todos-nondiary-end)
1009         (todos-date-string-start, todos-done-string-start)
1010         (todos-item-start): Change from defvar to defconst.
1011         (todos-set-top-priorities): Use read-number and simplify.
1012         (todos-insert-item): Check whether date-type argument is a string.
1013         (todos-set-date-from-calendar): Check whether
1014         todos-date-from-calendar is a string; simplify cond clause.
1015         (todos-archive-done-item, todos-unarchive-items):
1016         Use buffer-substring-no-properties.
1018 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1020         Changes from 2012-06-25 (revision 110017).
1021         * calendar/todos.el (todos-item-undo): Fix restoration on
1022         cancelling; use buffer-substring-no-properties; comment out code
1023         removing mark overlay; fix insertion of undone items; display any
1024         remaining done items.
1026 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1028         Changes from 2012-06-24 (revision 110016).
1029         * calendar/todos.el: Further significant code rearrangement;
1030         further comment revision.
1031         (todos-mode-display): New defgroup.
1032         (todos-prefix, todos-number-priorities)
1033         (todos-done-separator-string, todos-done-string)
1034         (todos-comment-string, todos-show-with-done)
1035         (todos-mode-line-function, todos-skip-archived-categories)
1036         (todos-highlight-item, todos-wrap-lines)
1037         (todos-line-wrapping-function): Use it.
1038         (todos-item-insertion): New defgroup.
1039         (todos-include-in-diary, todos-diary-nonmarking)
1040         (todos-nondiary-marker, todos-always-add-time-string)
1041         (todos-use-only-highlighted-region): Use it.
1042         (todos-forward-button, todos-backward-button): New commands.
1043         (todos-categories-mode-map): Use them, replacing forward-button
1044         and backward-button.
1045         (todos-merge-category): Fix and improve implementation; handle
1046         archived items.
1047         (todos-insert-item, todos-set-date-from-calendar): Handle setting
1048         date by calling todos-insert-item-from-calendar.
1049         (todos-delete-item): Fix overlay handling.
1050         (todos-move-item): Highlight item to be moved.
1051         (todos-item-undo): Handle marked items.
1052         (todos-insert-item-from-calendar): Rewrite using
1053         todos-date-from-calendar.
1055 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1057         Changes from 2012-06-21 (revision 110015).
1058         * calendar/todos.el: Further comment revision.
1059         (todos-sorted-column): Change default value, also taking tty into
1060         account.
1061         (todos-reset-done-separator): Fix faulty variable binding.
1062         (todos-reset-and-enable-done-separator): Save match data; comment
1063         out code that causes problems for Edebug.
1064         (todos-item-start): Handle empty line between todo and done items
1065         when done items are hidden.
1066         (todos-read-date): Use a leap year for `*' to allow
1067         calendar-last-day-of-month to return Feb. 29.
1068         (todos-archive-mode, todos-edit-mode, todos-categories-mode)
1069         (todos-filtered-items-mode): Delete faulty parentheses.
1070         (todos-quit): Save Todos and archive files unconditionally.
1071         (todos-forward-item): Accept only positive prefix argument.
1072         (todos-backward-item): Accept only positive prefix argument; don't
1073         move point to beginning of buffer if it is on the first item.
1074         (todos-hide-show-date-time): Remove obsolete interactive spec.
1075         (todos-move-category): Improve prompt string; ensure file moved to
1076         is different from file moved from.
1077         (todos-merge-categories): Remove.
1078         (todos-set-category-priority): New command.
1079         (todos-raise-category-priority, todos-lower-category-priority):
1080         Use it to define these commands.
1081         (todos-set-item-priority): Rewrite and generalize.
1082         (todos-raise-item-priority, todos-lower-item-priority): Use it to
1083         define these commands.
1085 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1087         Changes from 2012-06-15 (revision 110014).
1088         * calendar/todos.el (todos-reset-done-separator)
1089         (todos-reset-and-enable-done-separator): New functions.
1090         (todos-reset-done-separator-string): Rewrite using
1091         todos-reset-done-separator for string longer than 1 character.
1092         (todos-mode): Add todos-reset-and-enable-done-separator to
1093         window-configuration-change-hook, replacing previous anonymous
1094         function.
1095         (todos-unload-hook): And remove it.
1097 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1099         Changes from 2012-06-14 (revision 110013).
1100         * calendar/todos.el (todos-done-separator-string): New defcustom.
1101         (todos-done-separator): New variable replacing defcustom of the
1102         same name.
1103         (todos-reset-done-separator-string, todos-done-separator):
1104         New functions.
1105         (todos-mode): Make function added to
1106         window-configuration-change-hook do a better job of updating the
1107         done items separator string overlay.
1108         (todos-unload-hook): Remove it here.
1109         (todos-item-undo): Fix search for item's end.
1111 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1113         Changes from 2012-06-03 (revision 110012).
1114         * calendar/todos.el: Further comment revision.
1115         (todos-sorted-column): Change default value.
1116         (todos-item-start): Handle empty category (needed in
1117         todos-filter-items).
1118         (todos-read-date): Don't use calendar-read; make code cleaner.
1119         (todos-multiple-filter-files): Rename this variable from
1120         todos-multiple-files and adjust users.
1121         (todos-multiple-filter-files-widget): Rename from
1122         todos-multiple-files-widget and adjust users.
1123         (todos-multiple-filter-files): Rename this function from
1124         todos-multiple-files and adjust callers.
1125         (todos-filter-items): Remove unused code.
1126         (todos-insert-category-line): Add space so highlighting of last
1127         column is consistent with the others; adjust display of column
1128         highlighting.
1129         (todos-menu): Remove obsolete entry.
1130         (todos-categories-mode-map): Add new bindings.
1131         (todos-display-categories-alphabetically-or-by-priority): New command.
1132         (todos-display-categories-sorted-by-todo)
1133         (todos-display-categories-sorted-by-diary)
1134         (todos-display-categories-sorted-by-done)
1135         (todos-display-categories-sorted-by-archived): Restore and fix
1136         implementation.
1138 2012-09-23  Stephen Berman  <stephen.berman@gmx.net>
1140         Changes from 2012-06-02 (revision 110011).
1141         * calendar/todos.el: Significant code rearrangement; further
1142         comment revision.
1143         (todos-filtered-items-buffer): Rename from todos-filter-buffer and
1144         adjust users.
1145         (todos-filtered-buffer-name): Rename from
1146         todos-special-buffer-name and adjust users.
1147         (todos-filtered-items-mode-map): Rename from
1148         todos-filter-items-mode-map and adjust users.
1149         (todos-mode-external-set): Use todos-categories instead of
1150         todos-set-categories (and add comment to check if this DTRT).
1151         (todos-filtered-items-mode): Rename from todos-filter-items-mode
1152         and adjust users.
1153         (todos-add-category): Don't call todos-validate-name, since
1154         todos-read-category does.
1155         (todos-edit-quit): Use todos-repair-categories-sexp.
1156         (todos-done-item-add-edit-or-delete-comment): Rename from
1157         todos-done-item-add-or-edit-comment and adjust users; add optional
1158         argument to prompt to delete comment.
1159         (todos-item-undo): Delete done item comment on undoing if user
1160         confirms.
1162 2012-09-22  Stephen Berman  <stephen.berman@gmx.net>
1164         Changes from 2012-06-02 (revision 110010).
1165         * calendar/todos.el: Further code rearrangement and comment
1166         revision.
1167         (todos-item-start): Handle empty line between todo and done items
1168         when done items are displayed.
1169         (todos-key-bindings): Comment out bindings meant only for
1170         todos-archive-mode.
1171         (todos-archive-mode-map): Fix typo.
1172         (todos-archive-mode): Derive from special-mode instead of
1173         todos-mode to prevent its key bindings from being available here.
1174         (todos-archive-done-item): Remove obsolete code; fix item count
1175         updating.
1176         (todos-unarchive-items): Simplify; fix unarchiving of all items in
1177         category; fix item count updating; fix typo.
1179 2012-09-22  Stephen Berman  <stephen.berman@gmx.net>
1181         Changes from 2012-06-01 (revision 110009).
1182         * calendar/todos.el: Further code rearrangement and comment
1183         revision.
1184         (todos-add-to-buffer-list, todos-update-buffer-list): New functions.
1185         (todos-file-buffers): New variable.
1186         (todos-reset-global-current-todos-file): Use it to simplify
1187         implementation of this function.
1188         (todos-filtered): New defgroup.
1189         (todos-filter-buffer, todos-top-priorities-buffer)
1190         (todos-diary-items-buffer, todos-regexp-items-buffer)
1191         (todos-priorities-rules, todos-show-priorities)
1192         (todos-filter-files, todos-filter-done-items): Use it.
1193         (todos-skip-archived-categories): Rename from
1194         todos-ignore-archived-categories and adjust users.
1195         (todos-display-as-todos-file): Rename from todos-after-find-file
1196         and adjust callers.
1197         (todos-reset-highlight-item, todos-mode-external-set)
1198         (todos-jump-to-category, todos-jump-to-item)
1199         (todos-raise-category-priority, todos-insert-item)
1200         (todos-move-item): Use find-file-visiting.
1201         (todos-make-categories-list): Use file-truename.
1202         (todos-display-categories-1): Adjust title text for archive files;
1203         use done label for item counts in archive files.
1204         (todos-modes-set-3): Add todos-display-as-todos-file to
1205         find-file-hook.
1206         (todos-mode): Add todos-add-to-buffer-list to find-file-hook and
1207         todos-update-buffer-list post-command-hook.
1208         (todos-unload-hook): And remove them.
1209         (todos-show): Only when interactively invoked from an archive,
1210         switch to corresponding Todos file.
1211         (todos-archive-done-item): Remove obsolete code; fix handling of
1212         marked items; fix search for existing category; check whether
1213         archive exists and write to file if not; improve display handling.
1215 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1217         Changes from 2012-05-29 (revision 110008).
1218         * calendar/todos.el: Further comment revision.
1219         (todos-item-end): Replace use of command todos-forward-item by
1220         regexp searches using internal variables.
1221         (todos-raise-category-priority): Improve and comment.
1222         (todos-insert-item): Fix insertion of empty time string.
1224 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1226         Changes from 2012-05-29 (revision 110007).
1227         * calendar/todos.el (todos-ignore-archived-categories):
1228         Revert last change; remove :initialize and :set functions; change
1229         use and change users accordingly.
1230         (todos-reset-categories, todos-categories-full)
1231         (todos-truncate-categories-list): Remove.
1232         (todos-set-categories, todos-update-categories-sexp):
1233         Use todos-categories instead of todos-categories-full; remove use
1234         of todos-ignore-archived-categories and
1235         todos-truncate-categories-list.
1236         (todos-check-format, todos-repair-categories-sexp):
1237         Use todos-categories instead of todos-categories-full.
1238         (todos-read-category): Improve last change.
1239         (todos-validate-name): Use completing-read.
1240         (todos-categories-category-number): Rename from
1241         todos-category-number and adjust users.
1242         (todos-update-categories-display, todos-mode-external-set)
1243         (todos-delete-category, todos-move-category, todos-merge-category)
1244         (todos-unarchive-items): Remove use of todos-categories-full and
1245         todos-ignore-archived-categories.
1246         (todos-modes-set-3, todos-add-category): Remove use of
1247         todos-categories-full.
1248         (todos-edit-mode): Fix typo.
1249         (todos-forward-category): Use todos-ignore-archived-categories.
1251 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1253         Changes from 2012-05-28 (revision 110006).
1254         * calendar/todos.el: Doubts about todos-ignore-archived-categories.
1255         (todos-ignore-archived-categories): Change default value.
1257 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1259         Changes from 2012-05-27 (revision 110005).
1260         * calendar/todos.el: Further comment revision.
1261         (todos-reset-global-current-todos-file):
1262         Try to make this not slow down kill-buffer.
1263         (todos-update-categories-sexp): Handle the case where there is no
1264         categories sexp yet, i.e. after inserting the first item in the
1265         file, so todos-display-categories works.
1266         (todos-read-file-name): Improve implementation.
1267         (todos-validate-name): Use variable todos-files.
1268         (todos-category-number): New variable.
1269         (todos-insert-category-line, todos-update-categories-display)
1270         (todos-raise-category-priority): Use it.
1271         (todos-add-file): Remove unused remnant code.
1273 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1275         Changes from 2012-05-25 (revision 110004).
1276         * calendar/todos.el: Further comment revision.
1277         (todos-set-item-top-priority): New command.
1278         (todos-reset-global-current-todos-file):
1279         Use todos-files-function instead of todos-files.
1280         (todos-read-category): Add optional argument to test whether
1281         caller adds new category; if so, don't prompt for new category and
1282         don't restore original todos-categories list.
1283         (todos-categories-mode-map): Update to renamed commands.
1284         (todos-filter-items-mode-map): Add binding for new command.
1285         (todos-mode): Fix typo.
1286         (todos-show): If called from archive file, show corresponding
1287         category in Todos file, if it exists.
1288         (todos-jump-to-category): Remove code to add new category, since
1289         todos-read-category can do that.
1290         (todos-add-file): Remove obsolete code; visit new file in selected
1291         window.
1292         (todos-add-category): Simplify.
1293         (todos-rename-category): Use force-mode-line-update instead of
1294         setting mode-line-buffer-identification.
1295         (todos-delete-category): Improve logic of prompts; use
1296         todos-categories-full and check todos-ignore-archived-categories.
1297         (todos-raise-category-priority, todos-lower-category-priority):
1298         Rename from todos-{raise,lower}-category and adjust callers.
1299         (todos-move-category, todos-merge-category):
1300         Set todos-categories-full; on setting todos-categories check
1301         todos-ignore-archived-categories.
1302         (todos-insert-item): Let-bind use-empty-active-region and use
1303         use-region-p instead of transient-mark-mode.
1304         (todos-raise-item-priority): Improve implementation.
1305         (todos-archive-done-item): Rename from
1306         todos-archive-done-item-or-items and adjust callers; confine to
1307         Todos mode.
1308         (todos-unarchive-items): On setting todos-categories check
1309         todos-ignore-archived-categories.
1311 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1313         Changes from 2012-05-23 (revision 110003).
1314         * calendar/todos.el (todos-key-bindings): Remove binding of
1315         deleted command.
1316         (todos-menu): Remove entry of deleted command.
1317         (todos-show-archive): Fix last change.
1318         (todos-done-item-add-or-edit-comment): Rename from
1319         todos-comment-done-item and adjust callers; prompt to edit an
1320         existing comment.
1322 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1324         Changes from 2012-05-22 (revision 110002).
1325         * calendar/todos.el (todos-set-show-current-file): Rename from
1326         todos-toggle-show-current-file and adjust callers.
1327         (todos-number-priorities): Rename from todos-number-prefix and
1328         adjust users.
1329         (todos-update-count): Rename from todos-set-count and adjust
1330         callers.
1331         (todos-hide-show-item-numbering): Rename from
1332         todos-toggle-item-numbering and adjust callers.
1333         (todos-hide-show-done-items): Rename from
1334         todos-toggle-view-done-items and adjust callers.
1335         (todos-show-done-only): Rename from todos-toggle-show-done-only.
1336         (todos-view-archived-items): Comment out.
1337         (todos-show-archive): Prompt to choose another archive file if
1338         current Todos file lacks an archive; prompt to visit archive
1339         anyway when current category has no archived items.
1341 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1343         Changes from 2012-05-21 (revision 110001).
1344         * calendar/todos.el: Further comment revision and code
1345         rearrangement.
1346         (todos-item-end): Revert last change.
1347         (todos-key-bindings, todos-menu, todos-archive-mode-map)
1348         (todos-filter-items-mode-map): Use renamed commands.
1349         (todos-hide-show-date-time): Rename from
1350         todos-toggle-display-date-time.
1351         (todos-mark-unmark-item): Rename from todos-toggle-mark-item and
1352         adjust caller.
1353         (todos-backward-item): Exempt special handling only from
1354         todos-regexp-items-buffer instead of todos-filter-items-mode.
1355         (todos-raise-item-priority): Don't allow item reprioritizing in
1356         Todos filter items mode except for top priority items.
1358 2012-09-21  Stephen Berman  <stephen.berman@gmx.net>
1360         Changes from 2012-05-19 (revision 110000).
1361         * calendar/todos.el: Add and revise further doc strings and
1362         comments.
1363         (todos-filter-function, todos-custom-items)
1364         (todos-custom-items-multifile): Remove.
1365         (todos-filter-done-items): New defcustom.
1366         (todos-item-end, todos-backward-item): Handle todos-filter-items-mode.
1367         (todos-filter-items): Check return value of caller first; tag
1368         archived items for todos-jump-to-item; delete categories sexp
1369         before processing filter; check todos-filter-done-items for
1370         whether to leave done items; remove custom filter; fix regexp for
1371         file and category tags; don't invoke buffer fontification.
1372         (powerset-recursive): Fix typo.
1373         (todos-key-bindings): Remove unused bindings.
1374         (todos-top-priorities-multifile, todos-diary-items-multifile)
1375         (todos-regexp-items-multifile): Use variable todos-multiple-files.
1376         (todos-jump-to-item): Fix regexp; handle archive tags; take
1377         todos-filter-done-items into account.
1378         (todos-insert-item-from-calendar): Relocate to end of file
1379         together with key-binding as addition to calendar.el.
1381 2012-09-20  Stephen Berman  <stephen.berman@gmx.net>
1383         Changes from 2012-05-17 (revision 109999).
1384         * calendar/todos.el: Add and revise further doc strings and
1385         comments; major code rearrangement.
1386         (todos-merged-files, todos-prompt-merged-files)
1387         (todos-print-priorities, todos-tmp-buffer-name)
1388         (todos-top-priorities-widgets, todos-update-merged-files)
1389         (todos-merged-top-priorities, todos-merged-diary-items)
1390         (todos-merged-regexp-items, todos-merged-custom-items)
1391         (todos-raw-mode, todos-change-default-file)
1392         (todos-toggle-diary-inclusion, todos-toggle-item-diary-nonmarking)
1393         (todos-toggle-diary-nonmarking, todos-validate-category-name):
1394         Remove.
1395         (todos-category-string-matcher): Comment out.
1396         (todos-categories): New defgroup.
1397         (todos-initial-file, todos-filter-buffer)
1398         (todos-top-priorities-buffer, todos-categories-category-label)
1399         (todos-diary-items-buffer, todos-regexp-items-buffer)
1400         (todos-custom-items-buffer, todos-filter-files)
1401         (todos-highlight-item, todos-todo-mode-date-time-regexp):
1402         New defcustoms.
1403         (todos-diary-expired): New face.
1404         (todos-print-buffer, todos-multiple-files)
1405         (todos-multiple-files-widget, todos-key-bindings): New variables.
1406         (todos-short-file-name, todos-reevaluate-default-file-defcustom)
1407         (todos-special-buffer-name)
1408         (todos-reevaluate-filter-files-defcustom)
1409         (todos-reset-highlight-item, todos-reevaluate-defcustoms)
1410         (todos-nondiary-marker-matcher, todos-diary-nonmarking-matcher)
1411         (todos-diary-expired-matcher, todos-category-string-matcher-1)
1412         (todos-category-string-matcher-2, todos-repair-categories-sexp)
1413         (todos-validate-name, todos-multiple-files)
1414         (todos-display-categories-1, todos-update-categories-display)
1415         (todos-modes-set-3, todos-mode-external-set): New functions.
1416         (todos-set-top-priorities-in-file)
1417         (todos-set-top-priorities-in-category)
1418         (todos-top-priorities-multifile, todos-diary-items-multifile)
1419         (todos-regexp-items-multifile, todos-custom-items-multifile)
1420         (todos-convert-legacy-files, todos-jump-to-item)
1421         (todos-edit-multiline-item, todos-edit-item-date-from-calendar)
1422         (todos-edit-item-diary-inclusion)
1423         (todos-edit-category-diary-inclusion)
1424         (todos-edit-item-diary-nonmarking)
1425         (todos-edit-category-diary-nonmarking): New commands.
1426         (todos, todos-faces): Update :version.
1427         (todos-done-separator, todos-completion-ignore-case):
1428         Change default value.
1429         (todos-done-separator): Change :set function.
1430         (todos-indent-to-here): Add :validate function to :type.
1431         (todos-prefix-string, todos-mark, todos-button)
1432         (todos-sorted-column, todos-archived-only, todos-search)
1433         (todos-done, todos-done-sep): Provide full face definitions
1434         instead of inheriting.
1435         (todos-edit-buffer, todos-categories-buffer): Change from
1436         defcustom to defvar.
1437         (todos-category-beg, todos-category-done): Change from defvar to
1438         defconst.
1439         (todos-files): Check if todos-files-directory exists.
1440         (todos-default-todos-file, todos-mode-line-control, todos-print):
1441         Use todos-short-file-name.
1442         (todos-font-lock-keywords): Use todos-nondiary-marker-matcher,
1443         todos-diary-nonmarking-matcher, todos-category-string-matcher-1,
1444         todos-category-string-matcher-2, todos-diary-expired-matcher.
1445         (todos-category-select): Use todos-done-string-start, and
1446         condition search on todos-show-with-done; don't make display
1447         overlay for done items separator string if there already is one;
1448         use todos-highlight-item, require hl-line and activate
1449         hl-line-mode here in order to avoid a hang if done in todos-mode
1450         or the mode hook.
1451         (todos-update-categories-sexp): Use todos-categories-full if set,
1452         otherwise todos-categories.
1453         (todos-make-categories-list): Don't test for archive file when
1454         processing a legacy todo-mode file.
1455         (todos-check-format): Add check for todos-categories sexp.
1456         (todos-diary-item-p): Use todos-nondiary-start instead of
1457         todos-date-pattern.
1458         (todos-marked-item-p): Rename from todos-item-marked-p.
1459         (todos-read-file-name): Don't accept empty name; validate.
1460         (todos-read-category): Validate new name before prompting whether
1461         to add new category; force quit if user answers no.
1462         (todos-filter-items): Improve implementation.
1463         (todos-set-top-priorities): Rewrite as a noninteractive function
1464         using minibuffer input instead of widgets.
1465         (todos-insert-sort-button): Call todos-display-sorted with
1466         argument nil to display categories in numerical order, instead of
1467         calling todos-display-categories.
1468         (powerset-recursive): Borrow and slightly reformulate the (GDFL'd)
1469         Common Lisp powerset function at
1470         http://rosettacode.org/wiki/Power_set#Common_Lisp.
1471         (powerset-bitwise): Implement in Emacs Lisp the (GDFL'd) C
1472         powerset function at http://rosettacode.org/wiki/Power_set#C.
1473         (todos-powerset): Defalias to powerset-bitwise.
1474         (todos-mode-map): Generate from todos-key-bindings instead of
1475         listing each key definition.
1476         (todos-categories-mode-map): Add two bindings.
1477         (todos-filter-items-mode-map): Add some bindings, remove others.
1478         (todos-mode): Derive from special-mode; use todos-modes-set-3; add
1479         function setting todos-done-separator to
1480         window-configuration-change-hook.
1481         (todos-unload-hook): Remove function setting todos-done-separator
1482         from window-configuration-change-hook.
1483         (todos-archive-mode): Derive from todos-mode; use todos-modes-set-3.
1484         (todos-edit-mode): Derive from text-mode; use todos-mode-external-set.
1485         (todos-categories-mode): Derive from special-mode; use
1486         todos-mode-external-set.
1487         (todos-filter-items-mode): Derive from special-mode.
1488         (todos-quit): Save archive file if it hasn't yet been saved.
1489         (todos-display-categories): Delegate all functionality to
1490         todos-display-categories-1 and todos-update-categories-display.
1491         (todos-toggle-view-done-items): Improve implementation.
1492         (todos-highlight-item): Require hl-line.
1493         (todos-toggle-display-date-time): Remove argument and make it
1494         apply only to whole file.
1495         (todos-top-priorities, todos-diary-items, todos-regexp-items)
1496         (todos-custom-items): Use todos-special-buffer-name.
1497         (todos-add-file): Use todos-short-file-name and
1498         todos-reevaluate-defcustoms; remove validation, since it's now
1499         done in todos-read-file-name.
1500         (todos-add-category): Also update todos-categories-full if non-nil.
1501         (todos-delete-category): Delete file after confirmation if only
1502         category is deleted.
1503         (todos-move-category): Use todos-short-file-name and
1504         todos-reevaluate-defcustoms.
1505         (todos-insert-item): Fix getting date from the calendar and
1506         insertion of time string.
1507         (todos-set-date-from-calendar): Enter calendar buffer, suppressing
1508         display of diary entries.
1509         (todos-edit-multiline): Add optional argument to restrict editing
1510         buffer to current item, otherwise make entire buffer (i.e. whole
1511         file) editable.
1512         (todos-edit-quit): When whole file is editable, check file format
1513         validity before killing buffer, and if valid, recalculate
1514         categories sexp to be safe.
1515         (todos-edit-item-header): Allow choosing date from calendar.
1516         (todos-item-done): Handle marked items.
1518 2012-09-19  Stephen Berman  <stephen.berman@gmx.net>
1520         Changes from 2011-12-03 (revision 109998).
1521         * calendar/todos.el (todos-item-start): Restore commented out code
1522         to prevent wrongly moving point in widened buffer.
1524 2012-09-19  Stephen Berman  <stephen.berman@gmx.net>
1526         Changes from 2011-12-02 (revision 109997).
1527         * calendar/todos.el: Remove old commentary from todo-mode.el; add
1528         and revise further doc strings and comments; require cl.el at
1529         compile time for remove-duplicates; use function powerset from
1530         http://rosettacode.org/wiki/Power_set#Common_Lisp (GFDL); further
1531         code rearrangement.  Add adapted version of diary-goto-entry as comment.
1532         (todos-file-top, todos-archived-categories-buffer)
1533         (todos-save-top-priorities-too, todos-toggle-item-diary-inclusion)
1534         (todos-save-top-priorities, todos-reset-separator)
1535         (todos-switch-todos-file, todos-item-string-start, todos-counts)
1536         (todos-string-count-lines, todos-string-multiline-p)
1537         (todos-display-categories-alphabetically): Remove.
1538         (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1539         (todos-insert-item-ask-date-time-for-diary)
1540         (todos-insert-item-ask-date-time-for-diary-here)
1541         (todos-insert-item-ask-date-time-here)
1542         (todos-insert-item-ask-date-maybe-notime)
1543         (todos-insert-item-ask-date-maybe-notime-for-diary)
1544         (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1545         (todos-insert-item-ask-date-maybe-notime-here)
1546         (todos-insert-item-ask-date-for-diary)
1547         (todos-insert-item-ask-date-for-diary-here)
1548         (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1549         (todos-insert-item-ask-dayname-time)
1550         (todos-insert-item-ask-dayname-time-for-diary)
1551         (todos-insert-item-ask-dayname-time-for-diary-here)
1552         (todos-insert-item-ask-dayname-time-here)
1553         (todos-insert-item-ask-dayname-maybe-notime)
1554         (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1555         (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1556         (todos-insert-item-ask-dayname-maybe-notime-here)
1557         (todos-insert-item-ask-dayname-for-diary)
1558         (todos-insert-item-ask-dayname-for-diary-here)
1559         (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1560         (todos-insert-item-ask-time-for-diary)
1561         (todos-insert-item-ask-time-for-diary-here)
1562         (todos-insert-item-ask-time-here)
1563         (todos-insert-item-maybe-notime)
1564         (todos-insert-item-maybe-notime-for-diary)
1565         (todos-insert-item-maybe-notime-for-diary-here)
1566         (todos-insert-item-maybe-notime-here)
1567         (todos-insert-item-for-diary, todos-insert-item-for-diary-here)
1568         (todos-insert-item-here): Remove; all of these are now generated
1569         on loading (some with the same name, most with other names.)
1570         (todos-item-counts, todos-display-categories-alphabetically)
1571         (todos-display-categories-sorted-by-todo)
1572         (todos-display-categories-sorted-by-diary)
1573         (todos-display-categories-sorted-by-done)
1574         (todos-display-categories-sorted-by-archived): Comment out.
1575         (todos-comment-string, todos-mode-line-function)
1576         (todos-filter-function, todos-priorities-rules)
1577         (todos-visit-files-commands, todos-categories-totals-label)
1578         (todos-use-only-highlighted-region, todos-diary-nonmarking):
1579         New defcustoms.
1580         (todos-mark, todos-comment): New faces.
1581         (todos-comment-face): Corresponding new variable.
1582         (todos-categories-full, todos-global-current-todos-file)
1583         (todos-first-visit, todos-insertion-commands-args-genlist)
1584         (todos-insertion-commands-args, todos-insertion-commands-names)
1585         (todos-insertion-commands, todos-insertion-commands-arg-key-list)
1586         (todos-top-priorities-widgets, todos-date-from-calendar)
1587         (todos-item-mark, todos-categories-with-marks): New variables.
1588         (todos-mode-line-control, todos-reset-global-current-todos-file)
1589         (todos-gen-arglists, todos-insertion-command-name)
1590         (todos-insertion-key-bindings, todos-unload-hook)
1591         (todos-filter-items, todos-set-date-from-calendar)
1592         (todos-comment-string-matcher, todos-after-find-file)
1593         (todos-reset-nondiary-marker, todos-reset-done-string)
1594         (todos-reset-comment-string, todos-show-current-file)
1595         (todos-item-marked-p, todos-total-item-counts): New functions.
1596         (todos-define-insertion-command): New macro.
1597         (todos-toggle-mark-item, todos-mark-category)
1598         (todos-unmark-category, todos-set-top-priorities)
1599         (todos-merged-diary-items, todos-regexp-items)
1600         (todos-merged-regexp-items, todos-custom-items)
1601         (todos-merged-custom-items, todos-comment-done-item)
1602         (todos-archive-category-done-items, todos-unarchive-items)
1603         (todos-print-to-file): New commands.
1604         (todos-done-separator): Change :set function.
1605         (todos-done-string): Uncomment :initialize and :set functions.
1606         (todos-files): Use file-truename.
1607         (todos-show-current-file): Rename from
1608         todos-auto-switch-todos-file and change :set function accordingly.
1609         (todos-font-lock-keywords): Use todos-comment-string-matcher;
1610         change names of other matcher functions to new *-matcher.
1611         (todos-category-number): Change initial value.
1612         (todos-insertion-map): Use todos-insertion-key-bindings to
1613         generate key definitions.
1614         (todos-mode-map): Don't suppress digit keys, so they can supply
1615         prefix arguments; add new and change some existing bindings.
1616         (todos-archive-mode-map): Change a key binding.
1617         (todos-categories-mode-map): Comment out a key binding.
1618         (todos-filter-items-mode-map): Rename from
1619         todos-top-priorities-mode-map.
1620         (todos-mode): Make todos-current-todos-file,
1621         todos-categories-full, todos-categories, todos-first-visit,
1622         todos-category-number, todos-show-done-only,
1623         todos-categories-with-marks local variables and set them; add
1624         todos-show-current-file to pre-command-hook, todos-after-find-file
1625         to post-command-hook and todos-reset-global-current-todos-file to
1626         kill-buffer-hook.
1627         (todos-archive-mode): Make todos-current-todos-file,
1628         todos-categories and todos-category-number local variables and set
1629         them; add todos-after-find-file to post-command-hook.
1630         (todos-raw-mode): New derived major mode.
1631         (todos-categories-mode): Don't set font-lock-defaults and
1632         buffer-read-only; make todos-current-todos-file and
1633         todos-categories local variables and set them.
1634         (todos-filter-items-mode): Rename from todos-top-priorities-mode-map.
1635         (todos-quit): Don't reset todos-categories on quitting
1636         todos-categories-mode; handle quitting todos-filter-items-mode.
1637         (todos-show): Simplify; when visiting an archive file switch to
1638         corresponding Todos file; use todos-first-visit.
1639         (todos-view-archived-items): Simplify; call todos-category-number.
1640         (todos-show-archive): Rename from todos-switch-to-archive and
1641         adjust callers; simplify.
1642         (todos-toggle-display-date-time): Add optional argument to toggle
1643         display in entire file.
1644         (todos-top-priorities): Use todos-filter-items, which now contains
1645         the previous core of this command.
1646         (todos-merged-top-priorities, todos-diary-items):
1647         Use todos-filter-items.
1648         (todos-forward-category): Add optional argument to go to the
1649         previous category.
1650         (todos-backward-category): Use todos-forward-category.
1651         (todos-jump-to-category): Refine implementation.
1652         (todos-forward-item, todos-backward-item): Fix movement from todo
1653         to done item and vice versa.
1654         (todos-add-file): Remove argument and simplify.
1655         (todos-rename-category): Use todos-current-todos-file and
1656         todos-mode-line-function; set todos-categories with
1657         todos-set-categories.
1658         (todos-delete-category): Ask what to do if category has archived items.
1659         (todos-raise-category): Ensure modified todos-categories is added
1660         to file's categories sexp.
1661         (todos-move-category): Improve implementation, especially handling
1662         of archived categories.
1663         (todos-merge-category): Tweak; set item counts.
1664         (todos-insert-item): Improve handling of various argument values;
1665         add new argument values to control marking of diary items and to
1666         use region for item body.
1667         (todos-insert-item-from-calendar): Use todos-global-current-todos-file.
1668         (todos-delete-item, todos-edit-item-header): Handle marked items.
1669         (todos-edit-item): Incorporate functionality of removed
1670         todos-string-multiline-p.
1671         (todos-edit-multiline): Use set-window-buffer instead of
1672         switch-to-buffer.
1673         (todos-edit-quit): Don't save on quitting; use todos-show instead
1674         of todos-category-select.
1675         (todos-raise-item-priority): Add argument to lower priority;
1676         improve handling of top priority items in todos-filter-items-mode;
1677         restore marks.
1678         (todos-lower-item-priority): Use todos-raise-item-priority.
1679         (todos-set-item-priority): Increment maximum number if item is new.
1680         (todos-move-item): Handle marked items; delay changing category
1681         moved from till after movement to avoid restoring if user cancels
1682         before insertion.
1683         (todos-item-done): Add optional argument to insert comment; fix
1684         item counts and update sexp.
1685         (todos-item-undo): Fix item counts and update.
1686         (todos-archive-done-item-or-items): Rename from
1687         todos-archive-done-items; add optional argument to archive all
1688         items in category; handle marked items.
1689         (todos-unarchive-category): Use todos-unarchive-items.
1690         (todos-toggle-diary-inclusion): Incorporate functionality of
1691         removed todos-toggle-item-diary-inclusion; handle marked items.
1692         (todos-print): Add optional argument to print to file.
1693         (todos-done-string-start): Don't use todos-nondiary-start.
1694         (todos-date-string-matcher, todos-time-string-matcher)
1695         (todos-done-string-matcher, todos-category-string-matcher): Rename
1696         from *-match and adjust callers.
1697         (todos-wrap-and-indent): Use set instead of setq for local variables.
1698         (todos-prefix-overlays): Improve overlay handling.
1699         (todos-reset-categories): Fix and complete implementation.
1700         (todos-toggle-show-current-file): Rename from
1701         todos-toggle-switch-todos-file-noninteractively.
1702         (todos-category-select): Use todos-mode-line-function.
1703         (todos-item-start): Comment out code used by removed function.
1704         (todos-remove-item): Handle presence of both prefix/number and
1705         mark overlays.
1706         (todos-get-count): Simplify.
1707         (todos-set-count): Change argument list and adjust callers; simplify.
1708         (todos-set-categories): Handle new archive files; use
1709         todos-categories-full and todos-ignore-archived-categories.
1710         (todos-truncate-categories-list): Use todos-categories-full.
1711         (todos-update-categories-sexp): Use kill-region instead of
1712         kill-line; use todos-categories-full.
1713         (todos-read-file-name): Add argument to require existing file and
1714         adjust callers; use file-truename.
1715         (todos-read-category): Remove argument to require existing
1716         category and delegate it to completing-read in function body.
1717         (todos-validate-category-name): Make empty string prompt only for
1718         initial category name.
1719         (todos-read-date): Use = instead of eq for testing if month = 13,
1720         and if it is, set monthname to *.
1721         (todos-display-categories): Use todos-global-current-todos-file;
1722         use set-window-buffer instead of switch-to-buffer; add a line
1723         showing item count totals.
1724         (todos-padded-string): Use the longest of category name or label.
1725         (todos-descending-counts): Rename from
1726         todos-descending-counts-store and adjust users.
1727         (todos-insert-category-line): Adjust format; use mapconcat; kill
1728         buffer after jumping to category.
1730 2012-09-18  Stephen Berman  <stephen.berman@gmx.net>
1732         Changes from 2011-05-16 (revision 109996).
1733         * calendar/todos.el Add and revise various doc strings, remove
1734         further commented out code; add further comments; further code
1735         rearrangement.
1736         (todos-file-do, todos-archive-file, todos-mode-hook)
1737         (todos-edit-mode-hook, todos-exclusion-start, todos-exclusion-end)
1738         (todos-view-archive, todos-search-string)
1739         (todos-jump-to-category-noninteractively, todos-initial-setup):
1740         Remove.
1741         (todos-files): Remove this defcustom.
1742         (todos-initial-category, todos-display-categories-first)
1743         (todos-auto-switch-todos-file, todos-default-todos-file)
1744         (todos-categories-category-label, todos-categories-todo-label)
1745         (todos-categories-diary-label, todos-categories-done-label)
1746         (todos-categories-archived-label)
1747         (todos-categories-number-separator, todos-categories-align)
1748         (todos-ignore-archived-categories, todos-nondiary-marker):
1749         New defcustoms.
1750         (todos-prefix, todos-done-separator, todos-file-top)
1751         (todos-categories-buffer, todos-archived-categories-buffer)
1752         (todos-edit-buffer, todos-always-add-time-string, todos-button):
1753         Change default value.
1754         (todos-done-string): Add todos-reset-done-string as :set function,
1755         but keep this commented out.
1756         (todos-files, todos-archives, todos-insertion-map)
1757         (todos-category-done, todos-nondiary-start, todos-nondiary-end)
1758         (todos-show-done-only, todos-date-string-start)
1759         (todos-done-string-start): New variables.
1760         (todos-files-directory, todos-files-function, todos-merged-files)
1761         (todos-prompt-merged-files, todos-files, todos-modes-set-1)
1762         (todos-modes-set-2, todos-reset-done-string, todos-reset-categories)
1763         (todos-toggle-switch-todos-file-noninteractively)
1764         (todos-switch-todos-file, todos-counts, todos-get-count)
1765         (todos-set-count, todos-set-categories)
1766         (todos-truncate-categories-list, todos-update-categories-sexp)
1767         (todos-read-file-name, todos-sort, todos-display-sorted)
1768         (todos-label-to-key, todos-insert-sort-button): New functions.
1769         (todos-display-categories-sorted-by-todo)
1770         (todos-display-categories-sorted-by-diary)
1771         (todos-display-categories-sorted-by-done)
1772         (todos-display-categories-sorted-by-archived)
1773         (todos-update-merged-files, todos-switch-to-archive)
1774         (todos-choose-archive, todos-merged-top-priorities)
1775         (todos-jump-to-category-other-file, todos-clear-matches)
1776         (todos-add-file, todos-change-default-file, todos-move-category)
1777         (todos-merge-category, todos-merge-categories)
1778         (todos-edit-item-time, todos-move-item-to-file)
1779         (todos-unarchive-category, todos-toggle-item-diary-nonmarking)
1780         (todos-toggle-diary-nonmarking): New commands.
1781         (todos-toggle-show-done-only): New command replacing todos-view-archive.
1782         (todos-faces): New defgroup; use in all face definitions.
1783         (todos-sorted-column, todos-archived-only, todos-search): New faces.
1784         (todos-font-lock-keywords): Use subexpression 1 with matcher
1785         todos-category-string-match.
1786         (todos-mode-map, todos-archive-mode-map, todos-edit-mode-map)
1787         (todos-categories-mode-map): Add new key bindings; change some
1788         existing bindings.
1789         (todos-top-priorities-mode-map): New keymap.
1790         (todos-menu): Add submenues and new entries.
1791         (auto-mode-alist): Add extension of Todos and Todos archive files.
1792         (todos-mode, todos-archive-mode): Make derived mode; use
1793         todos-modes-set-1, todos-modes-set-2, todos-auto-switch-todos-file
1794         and todos-switch-todos-file; make todos-show-done-only local
1795         variable.
1796         (todos-edit-mode): Make derived mode; use todos-modes-set-1.
1797         (todos-categories-mode): Make derived mode.
1798         (todos-top-priorities-mode): New derived major mode.
1799         (todos-save): Remove unused code.
1800         (todos-quit): Handle todos-categories-mode; save archive buffer.
1801         (todos-show): Add optional argument to prompt for a Todos file; if
1802         called interactively or with prefix arg or from an archive, don't
1803         make a no-op but reset todos-current-todos-file, todos-categories
1804         and todos-category-number; use todos-read-file-name,
1805         todos-display-categories-first, todos-ignore-archived-categories.
1806         (todos-display-categories): Change argument name; refactor code
1807         for inserting table labels and lines, using
1808         todos-ignore-archived-categories, todos-sort,
1809         todos-categories-number-separator, todos-insert-sort-button,
1810         todos-categories-*-labels, and todos-insert-category-line.
1811         (todos-display-categories-alphabetically): Use todos-display-sorted.
1812         (todos-toggle-view-done-items): Use todos-done-string-start and
1813         todos-get-count.
1814         (todos-toggle-display-date-time): Use todos-done-string-start.
1815         (todos-top-priorities): Remove autoload cookie; partially rewrite:
1816         new argument list; allow combining top priorities of multiple
1817         Todos files; change display to include category (and file) name as
1818         part of item header; use todos-top-priorities-mode.
1819         (todos-diary-items): Reimplement using only todos-top-priorities.
1820         (todos-forward-category, todos-backward-category): Adjust to
1821         1-based numbering of categories; move point to top of category.
1822         (todos-jump-to-category): Rewrite, adding optional arguments to
1823         provide a category in non-interactive uses and to prompt for which
1824         Todos file to jump to.
1825         (todos-search): Reimplement; highlight each match as found, say
1826         how many matches remain and prompt whether to go to next one; at
1827         end of search prompt whether to remove highlighting.
1828         (todos-add-category): Remove autoload cookie; assign new category
1829         the highest category number; associate zero-initialized vector of
1830         item counts, instead of property list, with new category; use
1831         todos-validate-category-name and todos-update-categories-sexp.
1832         (todos-rename-category): Use todos-validate-category-name and
1833         todos-update-categories-sexp; take archive files into account.
1834         (todos-delete-category): Use todos-get-count and
1835         todos-update-categories-sexp, let-bind variable that were
1836         mistakenly global; use delete-region instead of kill-region;
1837         adjust to 1-based numbering of categories; move point to top of
1838         category.
1839         (todos-raise-category): Handle item count vectors; use
1840         todos-insert-category-line and todos-update-categories-sexp.
1841         (todos-insert-item): Use nil time-string argument to omit time
1842         string; use todos-nondiary-start and todos-nondiary-end and
1843         todos-update-categories-sexp; if category named to insert into
1844         does not exist, add it; take new diary items into account.
1845         (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1846         (todos-insert-item-ask-date-time-for-diary)
1847         (todos-insert-item-ask-date-time-for-diary-here)
1848         (todos-insert-item-ask-date-time-here)
1849         (todos-insert-item-ask-date-maybe-notime)
1850         (todos-insert-item-ask-date-maybe-notime-for-diary)
1851         (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1852         (todos-insert-item-ask-date-maybe-notime-here)
1853         (todos-insert-item-ask-date-for-diary)
1854         (todos-insert-item-ask-date-for-diary-here)
1855         (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1856         (todos-insert-item-ask-dayname-time)
1857         (todos-insert-item-ask-dayname-time-for-diary)
1858         (todos-insert-item-ask-dayname-time-for-diary-here)
1859         (todos-insert-item-ask-dayname-time-here)
1860         (todos-insert-item-ask-dayname-maybe-notime)
1861         (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1862         (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1863         (todos-insert-item-ask-dayname-maybe-notime-here)
1864         (todos-insert-item-ask-dayname-for-diary)
1865         (todos-insert-item-ask-dayname-for-diary-here)
1866         (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1867         (todos-insert-item-ask-time-for-diary)
1868         (todos-insert-item-ask-time-for-diary-here)
1869         (todos-insert-item-ask-time-here)
1870         (todos-insert-item-maybe-notime)
1871         (todos-insert-item-maybe-notime-for-diary)
1872         (todos-insert-item-maybe-notime-for-diary-here)
1873         (todos-insert-item-maybe-notime-here)
1874         (todos-insert-item-for-diary, todos-insert-item-for-diary-here):
1875         New insertion commands.
1876         (todos-insert-item-from-calendar): Use todos-current-todos-file.
1877         (todos-delete-item): Handle diary items;
1878         use todos-update-categories-sexp.
1879         (todos-edit-item): Check if point is with item string;
1880         use read-string instead of read-from-minibuffer;
1881         use todos-date-string-start; after editing put point at start of
1882         item text.
1883         (todos-edit-multiline): Narrow to item before invoking
1884         todos-edit-mode; show key binding of todos-edit-quit in a message.
1885         (todos-edit-quit): Use todos-save; kill buffer.
1886         (todos-edit-item-header): Add optional argument to prompt for
1887         editing only date string or only time string;
1888         use todos-date-string-start.
1889         (todos-edit-item-date, todos-edit-item-date-is-today)
1890         (todos-raise-item-priority, todos-lower-item-priority): Rename
1891         from todos-{raise, lower}-item and make them DTRT in
1892         todos-top-priorities-mode.
1893         (todos-set-item-priority): Make interactive; use todos-get-count
1894         and todos-insert-with-overlays; interactively, just relocate the
1895         item within its category.
1896         (todos-move-item): Add optional argument to prompt for a category
1897         in another Todos file; handle diary items; fix restoration after
1898         cancelling before inserting.
1899         (todos-item-done): Handle diary items; simplify handling of
1900         insertion in done items section.
1901         (todos-item-undo): Handle diary items.
1902         (todos-archive-done-items): Adjust to new handling of archive
1903         files (in parallel with Todos files); handle diary items; use
1904         todos-done-string-start.
1905         (todos-toggle-item-diary-inclusion): Use todos-nondiary-start,
1906         todos-nondiary-end and todos-item-counts.
1907         (todos-toggle-diary-inclusion): Use todos-category-done instead of
1908         todos-category-end.
1909         (todos-print): Remove autoload cookie; rewrite to make overlays,
1910         line wrapping and wrap prefixes printable.
1911         (todos-date-pattern): Make parenthesized groups shy.
1912         (todos-date-string-match): Use todos-date-string-start; make
1913         todos-date-pattern an explicitly numbered group.
1914         (todos-time-string-match): Use todos-date-string-start.
1915         (todos-done-string-match): Use todos-done-string-start.
1916         (todos-category-string-match): Rewrite to match new category and
1917         category+filename patterns in todos-top-priorities-mode.
1918         (todos-prefix-overlays): Use todos-done-string-start and
1919         todos-category-done.
1920         (todos-reset-prefix): Handle archive files; restore point after
1921         changing prefix.
1922         (todos-reset-separator): Handle archive files.
1923         (todos-category-number): Make category number one more than its
1924         list index.
1925         (todos-current-category): Adjust to 1-based numbering of categories.
1926         (todos-category-select): Simplify handling of done items and done
1927         separator string overlay.
1928         (todos-item-start): Use todos-date-string-start and
1929         todos-done-string-start.
1930         (todos-item-start, todos-item-end): Fix wrong parenthesizing.
1931         (todos-item-string): Restore point after getting item bounds; use
1932         buffer-substring-no-properties.
1933         (todos-done-item-p): Use todos-done-string-start.
1934         (todos-make-categories-list): Add optional argument to force
1935         looping through file to get categories and their item counts,
1936         otherwise set todos-categories from sexp in first line; use
1937         vectors of item counts instead of plists; count diary items.
1938         (todos-item-counts): Use todos-counts, todos-set-counts,
1939         todos-get-counts, and todos-update-categories-sexp instead of
1940         getting and setting properties; handle diary items.
1941         (todos-read-category): Add argument to set prompt; don't offer
1942         default category.
1943         (todos-validate-category-name): Rename from
1944         todos-check-category-name; take into account whether there are
1945         already categories or not.
1946         (todos-read-date): Accept `*' as an unspecified month, day, or year.
1947         (todos-padded-string): Accommodate new structure of
1948         todos-categories as alists; use todos-categories-align.
1949         (todos-descending-counts-store): New variable.
1950         (todos-insert-category-line): Rename from
1951         todos-insert-category-name and reimplement using labels and
1952         todos-get-counts instead of properties; use
1953         todos-ignore-archived-categories; highlight sorted column.
1955 2012-09-14  Stephen Berman  <stephen.berman@gmx.net>
1957         Changes from 2010-07-09 (revision 109995).
1958         * calendar/todos.el Remove lots of commented out code; add various
1959         comments; further code rearrangement.
1960         (todos-insert-item-here-ask-date-time)
1961         (todos-insert-item-ask-date-time)
1962         (todos-insert-item-ask-dayname-time)
1963         (todos-insert-item-for-diary)
1964         (todos-insert-item-for-diary-ask-date-time)
1965         (todos-make-categories-alist, todos-categories-alist): Remove.
1966         (todos-categories-list): Comment out.
1967         (todos-make-categories-list): New function replacing
1968         todos-make-categories-alist, using category plists to get item
1969         counts and taking archive into account.
1970         (todos-current-todos-file): New variable.
1971         (todos-mode-map): Update key bindings.
1972         (todos-save): Add as comment code to make sure todos-categories
1973         sexp is current on saving.
1974         (todos-quit): Call todos-show on quitting Todos archive buffer.
1975         (todos-show): If todos-current-todos-file is not set to Todos
1976         file, set it as a new file; set todos-categories from
1977         todos-make-categories-alist.
1978         (todos-display-categories): Use a different display format for
1979         archive file; put point initially on the first button.
1980         (todos-toggle-view-done-items): Check the category's `done'
1981         property to determine if there are done items.
1982         (todos-view-archive): Set todos-current-todos-file to the archive
1983         file; jump from the Todos file to the same category in the
1984         archive, if it exists, else jump to the first category; use
1985         message instead of error.
1986         (todos-add-category): Intern a special symbol for the new category
1987         and set its property list to holds counts of the numbers of todo,
1988         done and archived items in the category; assign the new category
1989         the current highest category number.
1990         (todos-rename-category): Don't use todos-categories-alist.
1991         (todos-delete-category): Check the category's `todo' and `done'
1992         properties to determine if it is empty; ensure that the end of the
1993         last category is found; after deleting the category, empty its
1994         plist and unintern its special symbol.
1995         (todos-insert-item-here): Fix argument list of todos-insert-item.
1996         (todos-delete-item, todos-raise-item, todos-lower-item):
1997         Use message instead of error.
1998         (todos-move-item): If the category to be moved to does not exist,
1999         add it as a new category.
2000         (todos-item-done, todos-reset-separator):
2001         Use todos-category-select instead of todos-show.
2002         (todos-archive-done-items): Make buffer writeable; conditionalize
2003         search for end of category; save after adding to archive in case
2004         the file is new, so it can be found.
2005         (todos-category-select): Wrap search in if instead of or+and;
2006         don't hide done items in an archive.
2007         (todos-set-item-priority): Check the category's `todo'
2008         property to determine if there are not done todo items.
2009         (todos-jump-to-category-noninteractively): Just switch to buffer
2010         visiting todos-current-todos-file, since this can be either a
2011         Todos file or an archive.
2012         (todos-item-counts): Use category's plist instead of an alist.
2013         (todos-longest-category-name-length): Argument is now a list of
2014         category names, not an alist, so just test each element, not each
2015         element's the car.
2016         (todos-padded-string): Use todos-categories instead of
2017         todos-categories-alist.
2018         (todos-insert-category-name): Use category plist to get item
2019         counts; take archived items into account.
2021 2012-09-13  Stephen Berman  <stephen.berman@gmx.net>
2023         Changes from 2010-06-18 (revision 109994).
2024         * calendar/todos.el: Numerous spelling and comment fixes, doc
2025         string fixes to conform with checkdoc, further rearrangement of
2026         definitions, etc.
2027         (todos-previous-line, todos-previous-answer)
2028         (todos-insert-item-ask-date, todos-change-date)
2029         (todos-date-nodayname-pattern, todos-dayname-date-pattern)
2030         (todos-count-items-in-category, todos-count-all-items): Remove.
2031         (todos-update-numbered-prefix, todos-item-start-overlays)
2032         (todos-add-item-non-interactively): Comment out, also in uses.
2033         (todos-done-separator): Change default value.
2034         (todos-always-add-time-string): Rename from todos-add-time-string
2035         and adjust uses.
2036         (todos-read-category): Rename from todos-completing-read and
2037         adjust callers; use todos-current-category.
2038         (todos-make-categories-alist): Rename from function
2039         todos-categories-alist.
2040         (todos-categories-alist): New variable.
2041         (todos-indent-to-here): New defcustom.
2042         (todos-button): New face.
2043         (todos-display-categories-alphabetically, todos-raise-category)
2044         (todos-lower-category, todos-insert-item-for-diary-ask-date-time)
2045         (todos-insert-item-here-ask-date-time)
2046         (todos-insert-item-ask-date-time)
2047         (todos-insert-item-ask-dayname-time): New commands.
2048         (todos-edit-item-header): New command replacing todos-change-date.
2049         (todos-category-number, todos-indent, todos-item-counts)
2050         (todos-check-category-name, todos-read-date, todos-read-dayname)
2051         (todos-read-time, todos-padded-string)
2052         (todos-insert-category-name): New functions.
2053         (todos-set-item-priority): New function replacing
2054         todos-add-item-non-interactively.
2055         (todos-mode-map): Remap newline to newline-and-indent.
2056         (todos-edit-mode-map): Make sparse keymap; remap newline to
2057         newline-and-indent.
2058         (todos-categories-mode-map): New keymap.
2059         (todos-mode, todos-edit-mode): Make indent-line-function local
2060         variable and set to todos-indent.
2061         (todos-categories-mode): New major mode.
2062         (todos-display-categories): List categories initially in their
2063         numerical order; add optional argument to switch to alphabetical
2064         listing.
2065         (todos-toggle-view-done-items): Simplify implementation.
2066         (todos-toggle-display-date-time): Fix regexp search string.
2067         (todos-backward-item, todos-forward-item): Use variable
2068         todos-item-start.
2069         (todos-add-category): Use todos-check-category-name and
2070         todos-categories-alist.
2071         (todos-rename-category): Use todos-current-category,
2072         todos-check-category-name and todos-categories-alist.
2073         (todos-delete-category): Use todos-check-category-name and
2074         todos-categories-alist and take done items into account.
2075         (todos-insert-item): Use separate arguments to handle insertion of
2076         date/dayname and time strings, add new argument to mark item for
2077         diary inclusion, use new todos-read-* functions,
2078         todos-set-item-priority and todos-item-counts.
2079         (todos-insert-item-here, todos-insert-item-for-diary)
2080         (todos-insert-item-from-calendar): Adapt to new version of
2081         todos-insert-item.
2082         (todos-delete-item, todos-item-done): Use todos-item-counts.
2083         (todos-edit-item): Indent newlines inserted by C-q C-j if nonspace
2084         char follows.
2085         (todos-lower-item): Ensure only not-done items can be lowered.
2086         (todos-move-item): Use todos-current-category, todos-read-category
2087         and todos-item-counts.
2088         (todos-archive-done-items): Use todos-current-category and
2089         todos-item-counts; fix regexp search string.
2090         (todos-item-undo): Use todos-current-category,
2091         todos-set-item-priority, todos-insert-with-overlays and
2092         todos-item-counts; restore if user quits before inserting undone
2093         item.
2094         (todos-date-pattern): Rewrite without using
2095         todos-date-nodayname-pattern and todos-dayname-date-pattern.
2096         (todos-date-string-match): Do not make todos-date-pattern an
2097         unnumbered group.
2098         (todos-time-string-match): Make todos-date-pattern a shy group.
2099         (todos-wrap-and-indent): Use todos-indent-to-here.
2100         (todos-reset-prefix): Revert to using todos-show instead of
2101         todos-category-select.
2102         (todos-prefix-overlays): Fix numbering of done items and updating
2103         of prefix.
2104         (todos-category-select): Use todos-current-category; fix display
2105         of separator string; don't move point to top of category.
2106         (todos-jump-to-category-noninteractively): Use todos-category-number.
2107         (todos-insert-with-overlays): Use todos-item-start unconditionally.
2108         (todos-item-start): New variable.
2109         (todos-item-start): Use it to define this function.
2110         (todos-item-end): Adjust if item is last unfinished one before
2111         displayed done items.
2112         (todos-remove-item): Use todos-item-start and todos-item-end
2113         instead of todos-forward-item and todos-backward-item.
2114         (todos-longest-category-name-length): Add argument for list of
2115         categories.
2117 2012-09-13  Stephen Berman  <stephen.berman@gmx.net>
2119         Changes from 2010-05-25 (revision 109993).
2120         * calendar/todos.el: Comment out calendar require, since diary-lib
2121         requires calendar.  Rearrange file to group definitions according
2122         to their use (types of commands, internal functions, etc.)
2123         (todos-file-done, todos-insert-threshold, todos-remove-separator)
2124         (todos-date-string, todos-time-string, todos-check-overlay)
2125         (todos-show-paren-hack, todos-file-item, todos-more-important-p):
2126         Comment out.
2127         (todos-current-date, todos-item-end-overlays)
2128         (todos-list-categories): Remove.
2129         (todos-item-end): Remove (the variable, not the function).
2130         (todos-prefix-overlays): Rename from todos-item-overlays and adjust
2131         callers.
2132         (todos-done-separator, todos-done-string, todos-show-with-done)
2133         (todos-files, todos-archive-file, todos-categories-buffer)
2134         (todos-archived-categories-buffer, todos-wrap-lines)
2135         (todos-line-wrapping-function): New defcustoms.
2136         (todos-done, todos-done-sep): New faces.
2137         (todos-done-face, todos-done-sep-face): Corresponding new variables.
2138         (todos-search-string, todos-date-nodayname-pattern)
2139         (todos-dayname-date-pattern, todos-date-pattern): New variables.
2140         (todos-done-string-match, todos-category-string-match)
2141         (todos-check-format, todos-wrap-and-indent, todos-reset-separator)
2142         (todos-current-category, todos-count-items-in-category)
2143         (todos-done-item-p, todos-categories-alist, todos-count-all-items)
2144         (todos-longest-category-name-length): New functions.
2145         (todos-categories-list): New buffer-specific function replacing
2146         todos-list-categories.
2147         (todos-toggle-item-numbering, todos-toggle-view-done-items)
2148         (todos-search, todos-view-archive, todos-diary-items)
2149         (todos-toggle-display-date-time, todos-insert-item-no-time)
2150         (todos-insert-item-ask-date, todos-insert-item-for-diary)
2151         (todos-insert-item-from-calendar, todos-edit-quit)
2152         (todos-change-date, todos-item-done, todos-archive-done-items)
2153         (todos-item-undo): New commands.
2154         (todos-archive-mode): New major mode.
2155         (todos-archive-mode-map, todos-edit-mode-map): New keymaps.
2156         (todos-category-beg): Change value.
2157         (todos-number-prefix): Change default value.
2158         (todos-edit-buffer): Change from defvar to defcustom.
2159         (todos-font-lock-keywords): Use todos-done-string-match and
2160         todos-category-string-match.
2161         (todos-backward-item, todos-forward-item): Use todos-done-string
2162         and todos-date-pattern.
2163         (todos-display-categories): Reimplement using buttons from
2164         button.el instead of widgets.
2165         (todos-top-priorities): Use with-current-buffer; take done items
2166         into account; ensure buffers gets fontified.
2167         (todos-add-category): Ensure new category does not begin with
2168         empty lines.
2169         (todos-jump-to-category): Use todos-category-select instead of
2170         todos-show.
2171         (todos-rename-category): Prompt for new name in body instead of in
2172         interactive spec.
2173         (todos-insert-item): Don't insert in done items section of
2174         category.  Add two optional arguments to control insertion: (i) to
2175         insert near point without prompting for priority; (ii) to use
2176         defaults for date and time strings, to prompt for these, or to
2177         choose date from the Calendar.
2178         (todos-insert-item-here): Reimplement using todos-insert-item.
2179         (todos-delete-item): Don't move point after deleting last item.
2180         (todos-raise-item, todos-lower-item): Take done items into account.
2181         (todos-move-item): Don't move done items; update item numbering;
2182         restore if user quits before inserting moved item.
2183         (todos-print): Prompt for confirmation to print.
2184         (todos-reset-prefix): Search backward from end of file instead of
2185         forward from top.
2186         (todos-jump-to-category-noninteractively): Take Todos archive into
2187         account.
2188         (todos-category-select): Show or hide done items according to
2189         todos-show-with-done; if shown, coordinate separator and prefix
2190         overlays.
2191         (todos-add-item-non-interactively): Replace binary insertion
2192         algorithm with prompting for numerical priority.
2193         (todos-insert-with-overlays): Remove use of variable todos-item-end.
2194         (todos-item-start): Take done items into account; use
2195         todos-date-pattern.
2196         (todos-item-end): Reimplement using todos-forward-item.
2197         (todos-remove-item): Reimplement using todos-forward-item and
2198         todos-backward-item; redo overlay handling.
2199         (todos-mode-map): Add some new key bindings and change numerous
2200         existing bindings; use "i" as prefix key for item insertion
2201         commands.
2202         (todos-mode): Use todos-wrap-lines and delegate word-wrap and
2203         wrap-prefix settings to todos-wrap-and-indent; add to invisibility
2204         spec; set buffer-read-only to t and consequently let-bind this
2205         variable in all Todos commands that change buffer content.
2206         (todos-edit-mode): Make an indepent mode, not derived from text-mode.
2207         (todos-save): Don't save top priorities buffer.
2208         (todos-show): Make a no-op if called interactively in narrowed
2209         Todos mode, since, also to work around item prefix reduplication
2210         bug with show-paren-mode enabled; use todos-categories-list.
2212 2012-09-12  Stephen Berman  <stephen.berman@gmx.net>
2214         Changes from 2009-11-07 (revision 109992).
2215         * calendar/todos.el: Comment out time-stamp require; require
2216         calendar and diary-lib.
2217         (todos-prefix): Change default value and doc string to reflect new
2218         meaning; add :initialize and :set functions.
2219         (todos-time-string-format, todos-entry-prefix-function)
2220         (todos-initials, todos-entry-timestamp-initials)
2221         (todos-prefix-face, todos-category-sep, todos-category-end)
2222         (todos-cp): Comment out.
2223         (todos-prefix-string): Inherit from font-lock-comment-face.
2224         (todos-item-header, todos-item-header-face): Remove.
2225         (todos-date, todos-time): New faces.
2226         (todos-date-face, todos-time-face): Corresponding new variables.
2227         (todos-add-time-string, todos-include-in-diary)
2228         (todos-exclusion-start, todos-exclusion-end, todos-number-prefix):
2229         New defcustoms.
2230         (todos-item-end, todos-item-start-overlays)
2231         (todos-item-end-overlays): New variables.
2232         (todos-date-string-match, todos-time-string-match): New functions.
2233         (todos-font-lock-keywords): Use them.
2234         (todos-current-date, todos-date-string, todos-time-string)
2235         (todos-toggle-item-diary-inclusion, todos-toggle-diary-inclusion)
2236         (todos-reset-prefix, todos-update-numbered-prefix)
2237         (todos-check-overlay, todos-item-overlays)
2238         (todos-insert-with-overlays, todos-show-paren-hack): New functions.
2239         (todos-highlight-item): New command.
2240         (todos-category-beg): Change value.
2241         (todos-category-select): Use todos-category-beg and todos-item-overlays.
2242         (todos-backward-item): Add optional count argument; use it and
2243         todos-item-start.
2244         (todos-forward-item): Use todos-check-overlay, todos-item-start
2245         and variable todos-item-end.
2246         (todos-edit-item, todos-delete-item): Use todos-number-prefix,
2247         todos-update-numbered-prefix, todos-item-overlays.
2248         (todos-add-category, todos-rename-category)
2249         (todos-list-categories): Use new category format.
2250         (todos-delete-category): Allow deleting non-empty category;
2251         use new category format.
2252         (todos-add-item-non-interactively): Comment out unnecessary
2253         save-excursion; use todos-insert-with-overlays.
2254         (todos-insert-item): Comment out unnecessary save-excursion; use
2255         new item format for date/time header and diary inclusion marking.
2256         (todos-insert-item-here): Use new item format for date/time header
2257         and diary inclusion marking; use todos-insert-with-overlays.
2258         (todos-raise-item): Make a no-op if point is on an empty line; use
2259         todos-insert-with-overlays.
2260         (todos-lower-item): Use todos-insert-with-overlays.
2261         (todos-top-priorities): Move call to todos-show inside
2262         save-excursion; add save-current-buffer after save-restriction.
2263         (todos-item-start): Use variable todos-item-end.
2264         (todos-item-end): Use todos-check-overlay and variable todos-item-end.
2265         (todos-remove-item): Take item overlays into account.
2266         (todos-mode): Change calculation of wrap-prefix; make
2267         hl-line-range-function a local variable and set it to highlight
2268         todo item.
2269         (todos-show): Ensure point stays at top of category.
2271 2012-09-12  Stephen Berman  <stephen.berman@gmx.net>
2273         Changes from 2009-07-04 (revision 109991).
2274         * calendar/todos.el (todos-window-configuration): Comment out.
2275         (todos-display-categories): Comment out use of
2276         todos-window-configuration; use switch-to-buffer instead of
2277         pop-to-buffer.
2278         (todos-jump-to-category-noninteractively): Comment out use of
2279         todos-window-configuration.
2280         (todos-edit-item): Don't allow editing of date/time item header.
2281         (todos-insert-item, todos-insert-item-here): Insert date/time
2282         header in front of new item string.
2283         (todos-mode): Tweak wrap-prefix.
2285 2012-09-12  Stephen Berman  <stephen.berman@gmx.net>
2287         Changes from 2009-06-26 (revision 109989).
2288         * calendar/todos.el (todos-file-do, todos-file-done):
2289         Change default location to directory "~/.emacs.d/".
2290         (todos-completion-ignore-case, todos-categories-buffer):
2291         New defcustoms.
2292         (todos-prefix-string, todos-item-header): New faces.
2293         (todos-prefix-face, todos-item-header-face): Corresponding
2294         new variables.
2295         (todos-rename-category, todos-delete-category)
2296         (todos-display-categories, todos-move-item): New commands.
2297         (todos-mode-map): Add key bindings for new commands and for
2298         todos-add-category, which had no key binding.
2299         (todos-jump-to-category-noninteractively): New function.
2300         (todos-top-priorities): Comment out code using a previously
2301         deleted variable.
2302         (todos-completing-read): Allow SPC to insert a space when entering
2303         a new category name; use todos-completion-ignore-case.
2304         (todos-font-lock-keywords, todos-window-configuration):
2305         New variables.
2306         (todos-mode): Make mode-name "TODOS"; make font-lock-defaults,
2307         word-wrap, and wrap-prefix local variables.
2309 2012-09-12  Stephen Berman  <stephen.berman@gmx.net>
2311         Changes from 2009-02-16 (revision 109988).
2312         * calendar/todos.el (todos-list-categories): Fix typos.
2313         (todos-show): Ensure file is in todos-mode.
2315 2012-09-12  Stephen Berman  <stephen.berman@gmx.net>
2317         Changes from 2009-02-12 (revision 109987).
2318         * calendar/todos.el (todos-header): Remove defvar.
2319         (todos-add-category): Comment out code that inserts and updates
2320         the file local variables first line of the file todos-file-do.
2321         (todos-list-categories): New function.
2322         (todos-show): Use it; remove use of a previously deleted variable.
2324 2012-09-11  Stephen Berman  <stephen.berman@gmx.net>
2326         Changes from 2009-02-12 (revision 109986).
2327         * calendar/todos.el: New file.  This is a copy of todo-mode.el
2328         from revision 94343 except for the following changes: replace all
2329         occurrences of the namespace prefix "todo-" with "todos-", delete
2330         the defvar todo-cats (the old name of todo-categories) and its use
2331         in todos-add-category, delete all defaliases of old command names.