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