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