aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Berman2013-04-19 15:34:47 +0200
committerStephen Berman2013-04-19 15:34:47 +0200
commitf1806c78f4da16f9f0123eddac86246ccfa960da (patch)
treed0cf9b90e00ff91c2ffd6d2b674b83468b2b05e4
parent40012197ec0773a9d42abf0c4c1052636f7c94ea (diff)
downloademacs-f1806c78f4da16f9f0123eddac86246ccfa960da.tar.gz
emacs-f1806c78f4da16f9f0123eddac86246ccfa960da.zip
* calendar/todos.el: Extend and improve item filtering and handling of
saved files of filtered items. (todos-show-first): Add choices for diary and regexp items. (todos-absolute-file-name): Handle file names for diary and regexp items. (todos-filter-items): New function abstracted from item filtering commands, with handling of saved files of diary and regexp items. (todos-filter-items-1): Rename from todos-filter-items. (todos-filtered-buffer-name): Remove, since functionality is now incorporated into new function todos-filter-items. (todos-filtered-items-buffer, todos-top-priorities-buffer) (todos-diary-items-buffer, todos-regexp-items-buffer): Make defconsts instead of defcustoms. (todos-find-item): Restrict calculation and comparison of priorities to top priority items, in order to handle diary and regexp items. (todos-check-filtered-items-file): Rename from todos-check-top-priorities and adjust message and callers. (todos-filter-items-filename): Rename from todos-top-priorities-filename, adjusting caller and extending to files of filtered diary and regexp items. (todos-save-filtered-items-buffer): Rename from todos-save-top-priorities-buffer and adjust caller and uses. Use write-file instead of write-region and use existing file name if previously saved. (todos-show): Handle initially displaying saved file of filtered diary or regexp items. (todos-top-priorities, todos-top-priorities-multifile) (todos-diary-items, todos-diary-items-multifile) (todos-regexp-items, todos-regexp-items-multifile): Use new function todos-filter-items. (auto-mode-alist): Extend regexp for files assigned to todos-filtered-items-mode to handle saved diary and regexp items.
-rw-r--r--lisp/ChangeLog1824
-rw-r--r--lisp/calendar/ChangeLog1859
-rw-r--r--lisp/calendar/todos.el389
3 files changed, 2069 insertions, 2003 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bb42d10aad2..cdc021d192f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,1827 +1,3 @@
12013-03-17 Stephen Berman <stephen.berman@gmx.net>
2
3 * calendar/todos.el (todos-insert-item): Fix mistake in logic of
4 here insertion from last change, and ensure category is set when
5 command is called from outside Todos buffer.
6
72013-03-15 Stephen Berman <stephen.berman@gmx.net>
8
9 * calendar/todos.el: Item unarchiving fixes and improvements.
10 (todos-archive-mode-map): Add bindings for item and category
11 marking/unmarking; make todos-display-categories binding same as
12 in Todos mode; remove todos-unarchive-category binding.
13 (todos-unarchive-category): Remove.
14 (todos-unarchive-items): Fix handling of marked items. Remove
15 code for unarchiving whole category, since that is covered by
16 unarchiving marked items. Handle unarchiving items to a category
17 that had been deleted from the todo file by re-adding the
18 category. Use todos-category-select to display restored items,
19 not todos-show. Remove obsolete or superfluous code.
20
212013-03-15 Stephen Berman <stephen.berman@gmx.net>
22
23 * calendar/todos.el (todos-reset-prefix): Don't remove overlays,
24 since it's superfluous and also wrongly removes items marks.
25 (todos-category-completions): Select current category on visiting
26 file, to ensure category is properly displayed if user switches to
27 file via a non-Todos command.
28 (todos-mark-category): Make implementation cleaner.
29 (todos-unmark-category): Improve implementation. Get overlay
30 property only when there is an overlay.
31
322013-03-14 Stephen Berman <stephen.berman@gmx.net>
33
34 * calendar/todos.el (todos-insert-item): Fix last change to make
35 sure calling insertion "here" from outside goal todo items section
36 gives new item top priority. With priority insertion, if user
37 cancels before setting priority, restore display.
38 (todos-find-item): Restore narrowing after searching.
39 (todos-item-done): Allow adding (same) comment to marked items.
40 Don't add empty comment to done item.
41
422013-03-13 Stephen Berman <stephen.berman@gmx.net>
43
44 * calendar/todos.el (todos-quit): If quitting
45 todos-filtered-items-mode makes todos-mode current, don't call
46 todos-show, which (here wrongly) prompts for a new Todos file.
47 (todos-delete-category): Fix incorrect quotation mark.
48 (todos-set-item-priority): Make prefix argument a no-op with
49 commands for raising or lowering item priority. Move mistakenly
50 placed right paren to end of defun, where it belongs.
51
522013-02-25 Stephen Berman <stephen.berman@gmx.net>
53
54 * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'.
55 (todos-show): Prompt for which todo file to visit when invoked
56 from Todos mode.
57
582013-02-19 Stephen Berman <stephen.berman@gmx.net>
59
60 * calendar/todos.el: Item insertion and done/undo fixes.
61 (todos-insert-item): Maybe set the insertion file to
62 todos-global-current-todos-file. When inserting into a file that
63 was not being visited on invoking this command, ensure chosen
64 category is properly selected. Make item inserted "here" the
65 first todo item if the command was invoked with point in done
66 items section or outside of the current category.
67 (todos-item-done): When done items are shown, put cursor on first
68 just done item.
69 (todos-item-undo): Put cursor on undone item.
70
712013-02-16 Stephen Berman <stephen.berman@gmx.net>
72
73 * calendar/todos.el: Improve handling of overlays.
74 (todos-get-overlay): New function.
75 (todos-prefix-overlay): Remove, since subsumed by
76 todos-get-overlay, and replace by the latter in callers.
77 (todos-reset-prefix): Apply only to buffer visiting Todos files.
78 Simplify implementation and use `todos' overlay property.
79 (todos-reset-done-separator): Use todos-get-overlay and `todos'
80 overlay property. Fix logic.
81 (todos-category-select): Use todos-get-overlay and `todos' overlay
82 property.
83 (todos-remove-item): Use todos-get-overlay. Correct obsolete code.
84 (todos-prefix-overlays): Use todos-top-priority face also for
85 non-numerical prefix of top priority items. Add `todos' overlay
86 property.
87 (todos-hide-show-date-time): Simplify, using todos-get-overlay and
88 `todos' overlay property.
89
902013-02-14 Stephen Berman <stephen.berman@gmx.net>
91
92 * calendar/todos.el (todos-edit-multiline, todos-edit-quit):
93 Revert buffer renaming.
94
952013-02-11 Stephen Berman <stephen.berman@gmx.net>
96
97 * calendar/todos.el (todos-edit-quit): On quitting file editing,
98 rename buffer back to current Todos file. After selecting
99 category, put point at top instead of recentering.
100
1012013-02-08 Stephen Berman <stephen.berman@gmx.net>
102
103 * calendar/todos.el (todos-edit-multiline-item): Revert to using
104 indirect buffer, which makes it easier to return to Todos mode.
105 (todos-edit-quit): Don't delete and reinsert items that don't need
106 indenting. Revert to just killing buffer on quitting single item
107 editing. On quitting file editing, select nearest category.
108
1092013-02-07 Stephen Berman <stephen.berman@gmx.net>
110
111 * calendar/todos.el: Bug fixes and improvements to item editing
112 and insertion.
113 (todos-check-format): Compare current value of todos-categories
114 with actual categories sexp.
115 (todos-repair-categories-sexp): Add warning to doc string about
116 category order getting restored to list element order.
117 (todos-mode-external-set): When todos-categories is nil, as in
118 Todos Edit mode, set it by reading actual categories sexp.
119 (todos-edit-mode): Make buffer writeable.
120 (todos-done-item-section-p): New function.
121 (todos-insert-item): Use it as part of preventing insertion here
122 in done items section. Move check for display of done items only
123 to just before setting new item's priority, and if cancelled after
124 toggling to todo items, restore display of done items.
125 (todos-edit-multiline-item): Don't base on todos-edit-multiline
126 but just narrow and change mode.
127 (todos-edit-multiline): Don't make indirect buffer but just widen
128 and change mode; also remove overlays.
129 (todos-edit-quit): Restore Todos mode and category display; when
130 quitting multiline item editing, ensure items above edited item
131 are visible in window if possible.
132 (todos-done-item-add-edit-or-delete-comment): If user moved point
133 during editing, make sure it moves back to edited item before
134 returning.
135
1362013-02-05 Stephen Berman <stephen.berman@gmx.net>
137
138 * calendar/todos.el (todos-reset-done-separator-string):
139 Complete the implementation.
140 (todos-hide-show-done-items): If start of done items sections is
141 below the bottom of the window, make it visible.
142 (todos-insert-item): Allow inserting item here to work outside of
143 the current category, but then at top of category. After checking
144 whether only done items are shown, restore point to ensure
145 inserting item here works correctly.
146 (todos-set-item-priority): Delete leftover right paren at end.
147
1482013-02-04 Stephen Berman <stephen.berman@gmx.net>
149
150 * calendar/todos.el: Bug fixes involving or displaying done items.
151 (todos-done-separator): Make length of long separator one less
152 than window-width, in order to avoid following empty line.
153 (todos-forward-item, todos-backward-item): Make empty line below
154 last todo item accessible only by invoking without a numerical
155 prefix argument and make the latter invocations move only to items.
156 (todos-insert-item): Set todos-current-todos-file after selecting
157 buffer, in order not to set global value. If only done items are
158 shown when this command is invoked, toggle to show todo items to
159 avoid insertion into done items section. When done items are
160 shown, protect from cancelling before setting item priority: this
161 also needs recentering to display all items.
162 (todos-set-item-priority): Only call on (not done) todo items.
163 Check that done items are visible not because file is widened.
164 Use only `any' argument of called-interactively-p. Make sure that
165 giving an undone item lowest priority restores it to the todo
166 section.
167 (todos-item-done): If done items are visible on invoking this
168 command, keep them visible afterwards. Stop looking for marked
169 items on reaching the empty line below the last todo item.
170
1712013-02-02 Stephen Berman <stephen.berman@gmx.net>
172
173 * calendar/todos.el: Several small fixes and improvements.
174 (todos-done-separator-string): Change default value.
175 (todos-update-categories-sexp): Remove unnecessary and misquided
176 setq of todos-default-todos-file. Use delete-region instead of
177 kill-region to avoid polluting kill-ring.
178 (todos-unload-hook): Remove (was not used).
179 (todos-edit-multiline): Don't generate new edit buffer name on
180 each invocation---that can cause confusion due to indirect buffer.
181 (todos-edit-quit): Ensure lines in edit buffer that follow hard
182 newlines are indented in the file to conform to diary format.
183 (todos-set-item-priority): If done items in category are visible,
184 keep them visible.
185
1862013-01-30 Stephen Berman <stephen.berman@gmx.net>
187
188 * calendar/todos.el: Fix done separator overlay bug. Remove most
189 FIXME comments.
190 (todos-reset-and-enable-done-separator): Remove commented out
191 workaround for done separator overlay bug; fix doc string.
192 (todos-reset-done-separator): Delete old overlay after adding new
193 overlay to fix done separator overlay bug; improve implementation.
194 (todos-prefix-overlays): Improve first line of doc string.
195
1962013-01-29 Stephen Berman <stephen.berman@gmx.net>
197
198 * calendar/todos.el: Improve item marking and handling of marked items.
199 (todos-prefix): Add validator to ensure value differs from that of
200 todos-item-mark.
201 (todos-item-mark): New defcustom.
202 (todos-prefix-overlay): New function.
203 (todos-marked-item-p): Use it. Adapt implementation to new
204 handling of marked items.
205 (todos-insert-with-overlays): When inserting pushes down a marked
206 item, move its prefix overlay.
207 (todos-prefix-overlays): Add overlay even when prefix is empty string,
208 otherwise item marking fails. Improve handling of marked items.
209 (todos-mark-unmark-item): Adapt to new handling of marked items
210 and simplify by removing marking of all items in category.
211 (todos-mark-category): Adapt to new handling of marked items and
212 don't use todos-mark-unmark-item.
213 (todos-unmark-category): Adapt to new handling of marked items.
214 (todos-delete-item): Remove obsolete handling of marked items and
215 useless restoration of point.
216 (todos-set-item-priority): Use new handling of marked items.
217 (todos-move-item, todos-item-done, todos-item-undo)
218 (todos-archive-done-item): Remove obsolete handling of marked items.
219
2202013-01-25 Stephen Berman <stephen.berman@gmx.net>
221
222 * calendar/todos.el: Improve definitions and use of some faces.
223 (todos-top-priority): Use current definition of font-lock-constant-face.
224 (todos-diary-expired): Make default value contrast more with
225 default value of todos-date face.
226 (todos-nondiary, todos-category-string): New faces.
227 (todos-nondiary-face, todos-category-string-face): Corresponding
228 new variables.
229 (todos-done, todos-comment): Switch default values to go better
230 with default value of todos-date face.
231 (todos-done-sep): Change default value.
232 (todos-category-string-matcher-1)
233 (todos-category-string-matcher-2): Improve doc string.
234 (todos-font-lock-keywords): Use todos-nondiary-face and
235 todos-category-string-face.
236 (todos-done-separator): Propertize string with todos-done-sep face.
237 (todos-filtered-items-mode): Fix typo.
238
2392013-01-23 Stephen Berman <stephen.berman@gmx.net>
240
241 * calendar/todos.el: Improve handling of saved top priorities items.
242 (todos-find-item): Find done items and items whose priority has
243 changed or whose text was truncated or augmented; add doc string.
244 (todos-check-top-priorities): Highlight each item that is not up
245 to date.
246 (todos-jump-to-item): Jump to items whose priority has changed or
247 whose text was truncated or augmented.
248
2492013-01-22 Stephen Berman <stephen.berman@gmx.net>
250
251 * calendar/todos.el: Revise handling of initial display and extend
252 to top priorities file.
253 (todos-display-categories-first): Remove, replacing by this:
254 (todos-show-first): New defcustom.
255 (todos-first-visit): Remove, replacing by this:
256 (todos-visited): New variable.
257 (todos-absolute-file-name): Extend possible values of optional
258 argument to take top priorities files into account.
259 (todos-modes-set-3, todos-mode): Remove use of todos-first-visit.
260 (todos-mode-external-set): Call find-file-noselect instead of
261 find-buffer-visiting, since the latter may fail.
262 (todos-show): Revise handling of initial display using
263 todos-show-first and todos-visited and extend to top priorities
264 file.
265 (todos-quit): Adapt to new handling of initial display.
266
2672013-01-14 Stephen Berman <stephen.berman@gmx.net>
268
269 * calendar/todos.el: Implement saving top priority items buffers,
270 improve implementation of item filtering commands and
271 infrastucture, and fix two bugs.
272 (todos-prefix-overlays): Use todos-top-priority face only in Todos
273 mode.
274 (todos-multiple-filter-files): Get file-truename of Todos file.
275 (todos-filter-items): Pass a list of files from the caller instead
276 of building it here, and move handling of cancelled file selection
277 dialog to callers. Correct omission of file-wide default number
278 of top priorities.
279 (todos-filtered-buffer-name): Treat file-list argument only as a list.
280 (todos-find-item, todos-check-top-priorities)
281 (todos-top-priorities-filename)
282 (todos-save-top-priorities-buffer): New functions.
283 (todos-save): Use todos-save-top-priorities-buffer.
284 (todos-jump-to-item): Refactor and use todos-find-item.
285 (todos-top-priorities): Simplify semantics of prefix argument.
286 Check if top priorities file exists and if so, visit it, reporting
287 whether it is up to date. Add optional argument and use it to
288 handle multiple files.
289 (todos-diary-items, todos-regexp-items): Add optional argument and
290 use it to handle multiple files.
291 (todos-top-priorities-multifile, todos-diary-items-multifile)
292 (todos-regexp-items-multifile): Refactor, using corresponding
293 non-multifile command.
294 (auto-mode-alist): Add pattern for top priorities files to visit
295 these in Todos Filtered Items mode.
296
2972013-01-08 Stephen Berman <stephen.berman@gmx.net>
298
299 * calendar/todos.el: Fix tabular alignment in Todos Categories mode.
300 (todos-adjusted-category-label-length): New function.
301 (todos-padded-string): Use it.
302
3032013-01-08 Stephen Berman <stephen.berman@gmx.net>
304
305 * calendar/todos.el (todos-move-item): Allow moving done items to
306 done section of another category.
307
3082013-01-06 Stephen Berman <stephen.berman@gmx.net>
309
310 * calendar/todos.el: Display numerical priority string of top
311 priority items in category in a distinctive face.
312 (todos-prefix-string): Make doc string more precise.
313 (todos-top-priority): New defface.
314 (todos-done, todos-done-sep): Use more compact face definition
315 \(taken from font-lock.el).
316 (todos-comment): Give a complete face definition, instead of
317 inheriting from todos-done.
318 (todos-font-lock-keywords): Use todos-comment-face for
319 todos-comment-string-matcher.
320 (todos-prefix-overlays): Use todos-top-priority as the face
321 property of top priority items; don't condition reapplying item
322 prefix overlay on whether the string changed, since that prevents
323 updating display after changing number of top priorities.
324 (todos-set-top-priorities): Call todos-prefix-overlays to update
325 display.
326
3272013-01-04 Stephen Berman <Stephen.Berman@rub.de>
328
329 * calendar/todos.el (todos-reset-global-current-todos-file)
330 (todos-display-categories-1): Use absolute name of
331 todos-default-todos-file.
332
3332013-01-04 Stephen Berman <Stephen.Berman@rub.de>
334
335 * calendar/todos.el (todos-insert-item): Fix copy and paste error
336 from previous change.
337
3382013-01-03 Stephen Berman <stephen.berman@gmx.net>
339
340 * calendar/todos.el: Implement extended category completions.
341 (todos-default-todos-file): Change default value to correct custom
342 type.
343 (todos-category-completions-files): New defcustom.
344 (todos-reevaluate-category-completions-files-defcustom)
345 (todos-absolute-file-name, todos-category-completions): New defuns.
346 (todos-reevaluate-filelist-defcustoms):
347 Add todos-category-completions-files and
348 todos-reevaluate-category-completions-files-defcustom.
349 (todos-allcats-file, todos-all-categories-alist)
350 (todos-jump-to-category-other-file, todos-jump-to-any-category)
351 (todos-move-item-to-file): Remove (todos-all-categories-alist both
352 as defvar and as defun).
353 (todos-read-category): Rewrite using extended category completions
354 and better handling of completion against existing or non-existing
355 categories.
356 (todos-validate-name): Correct doc string; use local instead of
357 dynamic variables in function body.
358 (todos-insert-category-line): Adjust use of todos-jump-to-category
359 to new argument list.
360 (todos-key-bindings, todos-menu): Delete entries for removed
361 commands.
362 (todos-show): Get absolute name of todos-default-todos-file;
363 add `nowarn' argument to find-file-noselect; adjust use of
364 todos-add-category to new argument list.
365 (todos-jump-to-category): Rewrite using extended category
366 completions; reverse argument list, adapting FILE argument to new
367 completion mechanism; add autoload cookie; call todos-show if
368 there are no Todos files.
369 (todos-add-category): Rewrite using extended category completions;
370 add FILE argument to accommodate new completion mechanism.
371 (todos-merge-category): Adapt to extended category completions,
372 adding prefix argument.
373 (todos-insert-item): Adapt to extended category completions; use
374 todos-read-category instead of todos-jump-to-category in prefix
375 argument calls; call todos-show if there are no Todos files; if
376 item is inserted at end of category, recenter to ensure the items
377 above it are displayed in the window.
378 (todos-move-item): Adapt to extended category completions, making
379 argument prefix argument; allow moving within category (for the
380 sake of code simplification); add `nowarn' argument to
381 find-file-noselect.
382 (todos-archive-done-item): Prevent error when attempting to
383 archive not-done todo item; adjust use of todos-add-category to
384 new argument list.
385
3862012-12-15 Stephen Berman <stephen.berman@gmx.net>
387
388 * calendar/todos.el (todos-archive-done-item): Fix archiving of
389 all done items in a category and resulting display of todo file.
390
3912012-12-14 Stephen Berman <stephen.berman@gmx.net>
392
393 * calendar/todos.el (todos-priorities-rules): Fix customization
394 type to prevent mismatch error.
395 (todos-set-top-priorities): Fix rule construction; fix input check;
396 improve prompt.
397
3982012-12-14 Stephen Berman <stephen.berman@gmx.net>
399
400 * calendar/todos.el (todos-insert-item): If user exits Calendar
401 before choosing a date, cancel item insertion.
402 (todos-set-date-from-calendar): If user exits Calendar before
403 choosing a date, clean up properly.
404
4052012-12-12 Stephen Berman <stephen.berman@gmx.net>
406
407 * calendar/todos.el: Extend and improve handling of item editing,
408 especially of date/time header.
409 (todos-month-name-array, todos-month-abbrev-array): New defconsts.
410 (todos-date-pattern): Use explicitly numbered groups.
411 (todos-read-date): Optionally read and return just one of the date
412 string components year, month or monthname, day.
413 (todos-key-bindings): Add bindings for new item header editing
414 commands.
415 (todos-edit-item): Exclude date/time header from minibuffer by
416 default; include it by passing a prefix argument.
417 (todos-edit-item-header-1): New function containing the guts of
418 the commands for editing item date/time headers.
419 (todos-edit-item-header): Use it. Condition editing of time
420 string on value of `todos-always-add-time-string'.
421 (todos-edit-item-date-from-calendar): Use todos-edit-item-header-1.
422 (todos-edit-item-date-to-today): Rename from
423 todos-edit-item-date-is-today and use todos-edit-item-header-1.
424 (todos-edit-item-date): Remove.
425 (todos-edit-item-date-day-name, todos-edit-item-date-year)
426 (todos-edit-item-date-month, todos-edit-item-date-day): New commands.
427
4282012-12-02 Stephen Berman <stephen.berman@gmx.net>
429
430 * calendar/todos.el (todos-show): Fix a comment.
431 (todos-add-category): Prompt for a new category if passed category
432 is the empty string, not nil.
433
4342012-11-26 Stephen Berman <stephen.berman@gmx.net>
435
436 * calendar/todos.el (todos-make-categories-list)
437 (todos-convert-legacy-files, todos-jump-to-item)
438 (todos-move-category, todos-merge-category)
439 (todos-archive-done-item, todos-unarchive-items): Include end of
440 line in regex searches for beginning of category, in order not to
441 get a category whose name contains the searched for category name.
442
4432012-11-15 Stephen Berman <stephen.berman@gmx.net>
444
445 * calendar/todos.el (todos-forward-category): Fix typo.
446
4472012-10-30 Stephen Berman <stephen.berman@gmx.net>
448
449 * calendar/todos.el (todos-define-insertion-command):
450 Let generated insertion commands accept a prefix argument.
451
4522012-10-08 Stephen Berman <Stephen.Berman@rub.de>
453
454 * calendar/todos.el (todos-move-item): If user quits before
455 completing movement, restore display of initial category; if item
456 is moved to end of target category, make sure the items above it
457 are displayed in the window.
458
4592012-10-08 Stephen Berman <stephen.berman@gmx.net>
460
461 * calendar/todos.el: Fixes to todos-move-item and some of its
462 subroutines.
463 (todos-move-item): When there are marked items, point need not be
464 on an item; remove obsolete use of todos-add-category, since this
465 is now already done in todos-read-category; fix typo.
466 (todos-diary-item-p): Exclude empty lines.
467 (todos-read-category): Restore point and narrowing after adding
468 new category, to avoid moving to beginning of file when moving
469 marked items to a new category.
470 (todos-set-item-priority): Prompt for priority only when the
471 category has at least one todo item; only use non-nil priority to
472 calculate insertion location.
473 (todos-read-category): Don't reset todos-categories when a new
474 category is added due to todos-move-item or todos-jump-to-item.
475
4762012-09-24 Stephen Berman <stephen.berman@gmx.net>
477
478 Changes from 2012-07-14 (revision 110020).
479 * calendar/todos.el (todos-copy-item): New command.
480 (todos-insertion-map): Add key binding for it.
481
4822012-09-24 Stephen Berman <stephen.berman@gmx.net>
483
484 Changes from 2012-07-13 (revision 110019).
485 * calendar/todos.el (todos-undo-item-omit-comment): New defcustom.
486 (todos-item-undo): Use it.
487 (todos-allcats-file, todos-all-categories-alist): New variables.
488 (todos-all-categories-alist): New function.
489 (todos-jump-to-any-category): New command.
490 (todos-move-item): Remove mark overlays from buffer items were
491 moved from; update todos-categories-with-marks,
492
4932012-09-24 Stephen Berman <stephen.berman@gmx.net>
494
495 Changes from 2012-06-27 (revision 110018).
496 * calendar/todos.el: Further code rearrangement; further new and
497 revised comments.
498 (todos-reevaluate-filelist-defcustoms): Rename from
499 todos-reevaluate-defcustoms and adjust callers.
500 (todos-date-pattern, todos-nondiary-start, todos-nondiary-end)
501 (todos-date-string-start, todos-done-string-start)
502 (todos-item-start): Change from defvar to defconst.
503 (todos-set-top-priorities): Use read-number and simplify.
504 (todos-insert-item): Check whether date-type argument is a string.
505 (todos-set-date-from-calendar): Check whether
506 todos-date-from-calendar is a string; simplify cond clause.
507 (todos-archive-done-item, todos-unarchive-items):
508 Use buffer-substring-no-properties.
509
5102012-09-23 Stephen Berman <stephen.berman@gmx.net>
511
512 Changes from 2012-06-25 (revision 110017).
513 * calendar/todos.el (todos-item-undo): Fix restoration on
514 cancelling; use buffer-substring-no-properties; comment out code
515 removing mark overlay; fix insertion of undone items; display any
516 remaining done items.
517
5182012-09-23 Stephen Berman <stephen.berman@gmx.net>
519
520 Changes from 2012-06-24 (revision 110016).
521 * calendar/todos.el: Further significant code rearrangement;
522 further comment revision.
523 (todos-mode-display): New defgroup.
524 (todos-prefix, todos-number-priorities)
525 (todos-done-separator-string, todos-done-string)
526 (todos-comment-string, todos-show-with-done)
527 (todos-mode-line-function, todos-skip-archived-categories)
528 (todos-highlight-item, todos-wrap-lines)
529 (todos-line-wrapping-function): Use it.
530 (todos-item-insertion): New defgroup.
531 (todos-include-in-diary, todos-diary-nonmarking)
532 (todos-nondiary-marker, todos-always-add-time-string)
533 (todos-use-only-highlighted-region): Use it.
534 (todos-forward-button, todos-backward-button): New commands.
535 (todos-categories-mode-map): Use them, replacing forward-button
536 and backward-button.
537 (todos-merge-category): Fix and improve implementation; handle
538 archived items.
539 (todos-insert-item, todos-set-date-from-calendar): Handle setting
540 date by calling todos-insert-item-from-calendar.
541 (todos-delete-item): Fix overlay handling.
542 (todos-move-item): Highlight item to be moved.
543 (todos-item-undo): Handle marked items.
544 (todos-insert-item-from-calendar): Rewrite using
545 todos-date-from-calendar.
546
5472012-09-23 Stephen Berman <stephen.berman@gmx.net>
548
549 Changes from 2012-06-21 (revision 110015).
550 * calendar/todos.el: Further comment revision.
551 (todos-sorted-column): Change default value, also taking tty into
552 account.
553 (todos-reset-done-separator): Fix faulty variable binding.
554 (todos-reset-and-enable-done-separator): Save match data; comment
555 out code that causes problems for Edebug.
556 (todos-item-start): Handle empty line between todo and done items
557 when done items are hidden.
558 (todos-read-date): Use a leap year for `*' to allow
559 calendar-last-day-of-month to return Feb. 29.
560 (todos-archive-mode, todos-edit-mode, todos-categories-mode)
561 (todos-filtered-items-mode): Delete faulty parentheses.
562 (todos-quit): Save Todos and archive files unconditionally.
563 (todos-forward-item): Accept only positive prefix argument.
564 (todos-backward-item): Accept only positive prefix argument; don't
565 move point to beginning of buffer if it is on the first item.
566 (todos-hide-show-date-time): Remove obsolete interactive spec.
567 (todos-move-category): Improve prompt string; ensure file moved to
568 is different from file moved from.
569 (todos-merge-categories): Remove.
570 (todos-set-category-priority): New command.
571 (todos-raise-category-priority, todos-lower-category-priority):
572 Use it to define these commands.
573 (todos-set-item-priority): Rewrite and generalize.
574 (todos-raise-item-priority, todos-lower-item-priority): Use it to
575 define these commands.
576
5772012-09-23 Stephen Berman <stephen.berman@gmx.net>
578
579 Changes from 2012-06-15 (revision 110014).
580 * calendar/todos.el (todos-reset-done-separator)
581 (todos-reset-and-enable-done-separator): New functions.
582 (todos-reset-done-separator-string): Rewrite using
583 todos-reset-done-separator for string longer than 1 character.
584 (todos-mode): Add todos-reset-and-enable-done-separator to
585 window-configuration-change-hook, replacing previous anonymous
586 function.
587 (todos-unload-hook): And remove it.
588
5892012-09-23 Stephen Berman <stephen.berman@gmx.net>
590
591 Changes from 2012-06-14 (revision 110013).
592 * calendar/todos.el (todos-done-separator-string): New defcustom.
593 (todos-done-separator): New variable replacing defcustom of the
594 same name.
595 (todos-reset-done-separator-string, todos-done-separator):
596 New functions.
597 (todos-mode): Make function added to
598 window-configuration-change-hook do a better job of updating the
599 done items separator string overlay.
600 (todos-unload-hook): Remove it here.
601 (todos-item-undo): Fix search for item's end.
602
6032012-09-23 Stephen Berman <stephen.berman@gmx.net>
604
605 Changes from 2012-06-03 (revision 110012).
606 * calendar/todos.el: Further comment revision.
607 (todos-sorted-column): Change default value.
608 (todos-item-start): Handle empty category (needed in
609 todos-filter-items).
610 (todos-read-date): Don't use calendar-read; make code cleaner.
611 (todos-multiple-filter-files): Rename this variable from
612 todos-multiple-files and adjust users.
613 (todos-multiple-filter-files-widget): Rename from
614 todos-multiple-files-widget and adjust users.
615 (todos-multiple-filter-files): Rename this function from
616 todos-multiple-files and adjust callers.
617 (todos-filter-items): Remove unused code.
618 (todos-insert-category-line): Add space so highlighting of last
619 column is consistent with the others; adjust display of column
620 highlighting.
621 (todos-menu): Remove obsolete entry.
622 (todos-categories-mode-map): Add new bindings.
623 (todos-display-categories-alphabetically-or-by-priority): New command.
624 (todos-display-categories-sorted-by-todo)
625 (todos-display-categories-sorted-by-diary)
626 (todos-display-categories-sorted-by-done)
627 (todos-display-categories-sorted-by-archived): Restore and fix
628 implementation.
629
6302012-09-23 Stephen Berman <stephen.berman@gmx.net>
631
632 Changes from 2012-06-02 (revision 110011).
633 * calendar/todos.el: Significant code rearrangement; further
634 comment revision.
635 (todos-filtered-items-buffer): Rename from todos-filter-buffer and
636 adjust users.
637 (todos-filtered-buffer-name): Rename from
638 todos-special-buffer-name and adjust users.
639 (todos-filtered-items-mode-map): Rename from
640 todos-filter-items-mode-map and adjust users.
641 (todos-mode-external-set): Use todos-categories instead of
642 todos-set-categories (and add comment to check if this DTRT).
643 (todos-filtered-items-mode): Rename from todos-filter-items-mode
644 and adjust users.
645 (todos-add-category): Don't call todos-validate-name, since
646 todos-read-category does.
647 (todos-edit-quit): Use todos-repair-categories-sexp.
648 (todos-done-item-add-edit-or-delete-comment): Rename from
649 todos-done-item-add-or-edit-comment and adjust users; add optional
650 argument to prompt to delete comment.
651 (todos-item-undo): Delete done item comment on undoing if user
652 confirms.
653
6542012-09-22 Stephen Berman <stephen.berman@gmx.net>
655
656 Changes from 2012-06-02 (revision 110010).
657 * calendar/todos.el: Further code rearrangement and comment
658 revision.
659 (todos-item-start): Handle empty line between todo and done items
660 when done items are displayed.
661 (todos-key-bindings): Comment out bindings meant only for
662 todos-archive-mode.
663 (todos-archive-mode-map): Fix typo.
664 (todos-archive-mode): Derive from special-mode instead of
665 todos-mode to prevent its key bindings from being available here.
666 (todos-archive-done-item): Remove obsolete code; fix item count
667 updating.
668 (todos-unarchive-items): Simplify; fix unarchiving of all items in
669 category; fix item count updating; fix typo.
670
6712012-09-22 Stephen Berman <stephen.berman@gmx.net>
672
673 Changes from 2012-06-01 (revision 110009).
674 * calendar/todos.el: Further code rearrangement and comment
675 revision.
676 (todos-add-to-buffer-list, todos-update-buffer-list): New functions.
677 (todos-file-buffers): New variable.
678 (todos-reset-global-current-todos-file): Use it to simplify
679 implementation of this function.
680 (todos-filtered): New defgroup.
681 (todos-filter-buffer, todos-top-priorities-buffer)
682 (todos-diary-items-buffer, todos-regexp-items-buffer)
683 (todos-priorities-rules, todos-show-priorities)
684 (todos-filter-files, todos-filter-done-items): Use it.
685 (todos-skip-archived-categories): Rename from
686 todos-ignore-archived-categories and adjust users.
687 (todos-display-as-todos-file): Rename from todos-after-find-file
688 and adjust callers.
689 (todos-reset-highlight-item, todos-mode-external-set)
690 (todos-jump-to-category, todos-jump-to-item)
691 (todos-raise-category-priority, todos-insert-item)
692 (todos-move-item): Use find-file-visiting.
693 (todos-make-categories-list): Use file-truename.
694 (todos-display-categories-1): Adjust title text for archive files;
695 use done label for item counts in archive files.
696 (todos-modes-set-3): Add todos-display-as-todos-file to
697 find-file-hook.
698 (todos-mode): Add todos-add-to-buffer-list to find-file-hook and
699 todos-update-buffer-list post-command-hook.
700 (todos-unload-hook): And remove them.
701 (todos-show): Only when interactively invoked from an archive,
702 switch to corresponding Todos file.
703 (todos-archive-done-item): Remove obsolete code; fix handling of
704 marked items; fix search for existing category; check whether
705 archive exists and write to file if not; improve display handling.
706
7072012-09-21 Stephen Berman <stephen.berman@gmx.net>
708
709 Changes from 2012-05-29 (revision 110008).
710 * calendar/todos.el: Further comment revision.
711 (todos-item-end): Replace use of command todos-forward-item by
712 regexp searches using internal variables.
713 (todos-raise-category-priority): Improve and comment.
714 (todos-insert-item): Fix insertion of empty time string.
715
7162012-09-21 Stephen Berman <stephen.berman@gmx.net>
717
718 Changes from 2012-05-29 (revision 110007).
719 * calendar/todos.el (todos-ignore-archived-categories):
720 Revert last change; remove :initialize and :set functions; change
721 use and change users accordingly.
722 (todos-reset-categories, todos-categories-full)
723 (todos-truncate-categories-list): Remove.
724 (todos-set-categories, todos-update-categories-sexp):
725 Use todos-categories instead of todos-categories-full; remove use
726 of todos-ignore-archived-categories and
727 todos-truncate-categories-list.
728 (todos-check-format, todos-repair-categories-sexp):
729 Use todos-categories instead of todos-categories-full.
730 (todos-read-category): Improve last change.
731 (todos-validate-name): Use completing-read.
732 (todos-categories-category-number): Rename from
733 todos-category-number and adjust users.
734 (todos-update-categories-display, todos-mode-external-set)
735 (todos-delete-category, todos-move-category, todos-merge-category)
736 (todos-unarchive-items): Remove use of todos-categories-full and
737 todos-ignore-archived-categories.
738 (todos-modes-set-3, todos-add-category): Remove use of
739 todos-categories-full.
740 (todos-edit-mode): Fix typo.
741 (todos-forward-category): Use todos-ignore-archived-categories.
742
7432012-09-21 Stephen Berman <stephen.berman@gmx.net>
744
745 Changes from 2012-05-28 (revision 110006).
746 * calendar/todos.el: Doubts about todos-ignore-archived-categories.
747 (todos-ignore-archived-categories): Change default value.
748
7492012-09-21 Stephen Berman <stephen.berman@gmx.net>
750
751 Changes from 2012-05-27 (revision 110005).
752 * calendar/todos.el: Further comment revision.
753 (todos-reset-global-current-todos-file):
754 Try to make this not slow down kill-buffer.
755 (todos-update-categories-sexp): Handle the case where there is no
756 categories sexp yet, i.e. after inserting the first item in the
757 file, so todos-display-categories works.
758 (todos-read-file-name): Improve implementation.
759 (todos-validate-name): Use variable todos-files.
760 (todos-category-number): New variable.
761 (todos-insert-category-line, todos-update-categories-display)
762 (todos-raise-category-priority): Use it.
763 (todos-add-file): Remove unused remnant code.
764
7652012-09-21 Stephen Berman <stephen.berman@gmx.net>
766
767 Changes from 2012-05-25 (revision 110004).
768 * calendar/todos.el: Further comment revision.
769 (todos-set-item-top-priority): New command.
770 (todos-reset-global-current-todos-file):
771 Use todos-files-function instead of todos-files.
772 (todos-read-category): Add optional argument to test whether
773 caller adds new category; if so, don't prompt for new category and
774 don't restore original todos-categories list.
775 (todos-categories-mode-map): Update to renamed commands.
776 (todos-filter-items-mode-map): Add binding for new command.
777 (todos-mode): Fix typo.
778 (todos-show): If called from archive file, show corresponding
779 category in Todos file, if it exists.
780 (todos-jump-to-category): Remove code to add new category, since
781 todos-read-category can do that.
782 (todos-add-file): Remove obsolete code; visit new file in selected
783 window.
784 (todos-add-category): Simplify.
785 (todos-rename-category): Use force-mode-line-update instead of
786 setting mode-line-buffer-identification.
787 (todos-delete-category): Improve logic of prompts; use
788 todos-categories-full and check todos-ignore-archived-categories.
789 (todos-raise-category-priority, todos-lower-category-priority):
790 Rename from todos-{raise,lower}-category and adjust callers.
791 (todos-move-category, todos-merge-category):
792 Set todos-categories-full; on setting todos-categories check
793 todos-ignore-archived-categories.
794 (todos-insert-item): Let-bind use-empty-active-region and use
795 use-region-p instead of transient-mark-mode.
796 (todos-raise-item-priority): Improve implementation.
797 (todos-archive-done-item): Rename from
798 todos-archive-done-item-or-items and adjust callers; confine to
799 Todos mode.
800 (todos-unarchive-items): On setting todos-categories check
801 todos-ignore-archived-categories.
802
8032012-09-21 Stephen Berman <stephen.berman@gmx.net>
804
805 Changes from 2012-05-23 (revision 110003).
806 * calendar/todos.el (todos-key-bindings): Remove binding of
807 deleted command.
808 (todos-menu): Remove entry of deleted command.
809 (todos-show-archive): Fix last change.
810 (todos-done-item-add-or-edit-comment): Rename from
811 todos-comment-done-item and adjust callers; prompt to edit an
812 existing comment.
813
8142012-09-21 Stephen Berman <stephen.berman@gmx.net>
815
816 Changes from 2012-05-22 (revision 110002).
817 * calendar/todos.el (todos-set-show-current-file): Rename from
818 todos-toggle-show-current-file and adjust callers.
819 (todos-number-priorities): Rename from todos-number-prefix and
820 adjust users.
821 (todos-update-count): Rename from todos-set-count and adjust
822 callers.
823 (todos-hide-show-item-numbering): Rename from
824 todos-toggle-item-numbering and adjust callers.
825 (todos-hide-show-done-items): Rename from
826 todos-toggle-view-done-items and adjust callers.
827 (todos-show-done-only): Rename from todos-toggle-show-done-only.
828 (todos-view-archived-items): Comment out.
829 (todos-show-archive): Prompt to choose another archive file if
830 current Todos file lacks an archive; prompt to visit archive
831 anyway when current category has no archived items.
832
8332012-09-21 Stephen Berman <stephen.berman@gmx.net>
834
835 Changes from 2012-05-21 (revision 110001).
836 * calendar/todos.el: Further comment revision and code
837 rearrangement.
838 (todos-item-end): Revert last change.
839 (todos-key-bindings, todos-menu, todos-archive-mode-map)
840 (todos-filter-items-mode-map): Use renamed commands.
841 (todos-hide-show-date-time): Rename from
842 todos-toggle-display-date-time.
843 (todos-mark-unmark-item): Rename from todos-toggle-mark-item and
844 adjust caller.
845 (todos-backward-item): Exempt special handling only from
846 todos-regexp-items-buffer instead of todos-filter-items-mode.
847 (todos-raise-item-priority): Don't allow item reprioritizing in
848 Todos filter items mode except for top priority items.
849
8502012-09-21 Stephen Berman <stephen.berman@gmx.net>
851
852 Changes from 2012-05-19 (revision 110000).
853 * calendar/todos.el: Add and revise further doc strings and
854 comments.
855 (todos-filter-function, todos-custom-items)
856 (todos-custom-items-multifile): Remove.
857 (todos-filter-done-items): New defcustom.
858 (todos-item-end, todos-backward-item): Handle todos-filter-items-mode.
859 (todos-filter-items): Check return value of caller first; tag
860 archived items for todos-jump-to-item; delete categories sexp
861 before processing filter; check todos-filter-done-items for
862 whether to leave done items; remove custom filter; fix regexp for
863 file and category tags; don't invoke buffer fontification.
864 (powerset-recursive): Fix typo.
865 (todos-key-bindings): Remove unused bindings.
866 (todos-top-priorities-multifile, todos-diary-items-multifile)
867 (todos-regexp-items-multifile): Use variable todos-multiple-files.
868 (todos-jump-to-item): Fix regexp; handle archive tags; take
869 todos-filter-done-items into account.
870 (todos-insert-item-from-calendar): Relocate to end of file
871 together with key-binding as addition to calendar.el.
872
8732012-09-20 Stephen Berman <stephen.berman@gmx.net>
874
875 Changes from 2012-05-17 (revision 109999).
876 * calendar/todos.el: Add and revise further doc strings and
877 comments; major code rearrangement.
878 (todos-merged-files, todos-prompt-merged-files)
879 (todos-print-priorities, todos-tmp-buffer-name)
880 (todos-top-priorities-widgets, todos-update-merged-files)
881 (todos-merged-top-priorities, todos-merged-diary-items)
882 (todos-merged-regexp-items, todos-merged-custom-items)
883 (todos-raw-mode, todos-change-default-file)
884 (todos-toggle-diary-inclusion, todos-toggle-item-diary-nonmarking)
885 (todos-toggle-diary-nonmarking, todos-validate-category-name):
886 Remove.
887 (todos-category-string-matcher): Comment out.
888 (todos-categories): New defgroup.
889 (todos-initial-file, todos-filter-buffer)
890 (todos-top-priorities-buffer, todos-categories-category-label)
891 (todos-diary-items-buffer, todos-regexp-items-buffer)
892 (todos-custom-items-buffer, todos-filter-files)
893 (todos-highlight-item, todos-todo-mode-date-time-regexp):
894 New defcustoms.
895 (todos-diary-expired): New face.
896 (todos-print-buffer, todos-multiple-files)
897 (todos-multiple-files-widget, todos-key-bindings): New variables.
898 (todos-short-file-name, todos-reevaluate-default-file-defcustom)
899 (todos-special-buffer-name)
900 (todos-reevaluate-filter-files-defcustom)
901 (todos-reset-highlight-item, todos-reevaluate-defcustoms)
902 (todos-nondiary-marker-matcher, todos-diary-nonmarking-matcher)
903 (todos-diary-expired-matcher, todos-category-string-matcher-1)
904 (todos-category-string-matcher-2, todos-repair-categories-sexp)
905 (todos-validate-name, todos-multiple-files)
906 (todos-display-categories-1, todos-update-categories-display)
907 (todos-modes-set-3, todos-mode-external-set): New functions.
908 (todos-set-top-priorities-in-file)
909 (todos-set-top-priorities-in-category)
910 (todos-top-priorities-multifile, todos-diary-items-multifile)
911 (todos-regexp-items-multifile, todos-custom-items-multifile)
912 (todos-convert-legacy-files, todos-jump-to-item)
913 (todos-edit-multiline-item, todos-edit-item-date-from-calendar)
914 (todos-edit-item-diary-inclusion)
915 (todos-edit-category-diary-inclusion)
916 (todos-edit-item-diary-nonmarking)
917 (todos-edit-category-diary-nonmarking): New commands.
918 (todos, todos-faces): Update :version.
919 (todos-done-separator, todos-completion-ignore-case):
920 Change default value.
921 (todos-done-separator): Change :set function.
922 (todos-indent-to-here): Add :validate function to :type.
923 (todos-prefix-string, todos-mark, todos-button)
924 (todos-sorted-column, todos-archived-only, todos-search)
925 (todos-done, todos-done-sep): Provide full face definitions
926 instead of inheriting.
927 (todos-edit-buffer, todos-categories-buffer): Change from
928 defcustom to defvar.
929 (todos-category-beg, todos-category-done): Change from defvar to
930 defconst.
931 (todos-files): Check if todos-files-directory exists.
932 (todos-default-todos-file, todos-mode-line-control, todos-print):
933 Use todos-short-file-name.
934 (todos-font-lock-keywords): Use todos-nondiary-marker-matcher,
935 todos-diary-nonmarking-matcher, todos-category-string-matcher-1,
936 todos-category-string-matcher-2, todos-diary-expired-matcher.
937 (todos-category-select): Use todos-done-string-start, and
938 condition search on todos-show-with-done; don't make display
939 overlay for done items separator string if there already is one;
940 use todos-highlight-item, require hl-line and activate
941 hl-line-mode here in order to avoid a hang if done in todos-mode
942 or the mode hook.
943 (todos-update-categories-sexp): Use todos-categories-full if set,
944 otherwise todos-categories.
945 (todos-make-categories-list): Don't test for archive file when
946 processing a legacy todo-mode file.
947 (todos-check-format): Add check for todos-categories sexp.
948 (todos-diary-item-p): Use todos-nondiary-start instead of
949 todos-date-pattern.
950 (todos-marked-item-p): Rename from todos-item-marked-p.
951 (todos-read-file-name): Don't accept empty name; validate.
952 (todos-read-category): Validate new name before prompting whether
953 to add new category; force quit if user answers no.
954 (todos-filter-items): Improve implementation.
955 (todos-set-top-priorities): Rewrite as a noninteractive function
956 using minibuffer input instead of widgets.
957 (todos-insert-sort-button): Call todos-display-sorted with
958 argument nil to display categories in numerical order, instead of
959 calling todos-display-categories.
960 (powerset-recursive): Borrow and slightly reformulate the (GDFL'd)
961 Common Lisp powerset function at
962 http://rosettacode.org/wiki/Power_set#Common_Lisp.
963 (powerset-bitwise): Implement in Emacs Lisp the (GDFL'd) C
964 powerset function at http://rosettacode.org/wiki/Power_set#C.
965 (todos-powerset): Defalias to powerset-bitwise.
966 (todos-mode-map): Generate from todos-key-bindings instead of
967 listing each key definition.
968 (todos-categories-mode-map): Add two bindings.
969 (todos-filter-items-mode-map): Add some bindings, remove others.
970 (todos-mode): Derive from special-mode; use todos-modes-set-3; add
971 function setting todos-done-separator to
972 window-configuration-change-hook.
973 (todos-unload-hook): Remove function setting todos-done-separator
974 from window-configuration-change-hook.
975 (todos-archive-mode): Derive from todos-mode; use todos-modes-set-3.
976 (todos-edit-mode): Derive from text-mode; use todos-mode-external-set.
977 (todos-categories-mode): Derive from special-mode; use
978 todos-mode-external-set.
979 (todos-filter-items-mode): Derive from special-mode.
980 (todos-quit): Save archive file if it hasn't yet been saved.
981 (todos-display-categories): Delegate all functionality to
982 todos-display-categories-1 and todos-update-categories-display.
983 (todos-toggle-view-done-items): Improve implementation.
984 (todos-highlight-item): Require hl-line.
985 (todos-toggle-display-date-time): Remove argument and make it
986 apply only to whole file.
987 (todos-top-priorities, todos-diary-items, todos-regexp-items)
988 (todos-custom-items): Use todos-special-buffer-name.
989 (todos-add-file): Use todos-short-file-name and
990 todos-reevaluate-defcustoms; remove validation, since it's now
991 done in todos-read-file-name.
992 (todos-add-category): Also update todos-categories-full if non-nil.
993 (todos-delete-category): Delete file after confirmation if only
994 category is deleted.
995 (todos-move-category): Use todos-short-file-name and
996 todos-reevaluate-defcustoms.
997 (todos-insert-item): Fix getting date from the calendar and
998 insertion of time string.
999 (todos-set-date-from-calendar): Enter calendar buffer, suppressing
1000 display of diary entries.
1001 (todos-edit-multiline): Add optional argument to restrict editing
1002 buffer to current item, otherwise make entire buffer (i.e. whole
1003 file) editable.
1004 (todos-edit-quit): When whole file is editable, check file format
1005 validity before killing buffer, and if valid, recalculate
1006 categories sexp to be safe.
1007 (todos-edit-item-header): Allow choosing date from calendar.
1008 (todos-item-done): Handle marked items.
1009
10102012-09-19 Stephen Berman <stephen.berman@gmx.net>
1011
1012 Changes from 2011-12-03 (revision 109998).
1013 * calendar/todos.el (todos-item-start): Restore commented out code
1014 to prevent wrongly moving point in widened buffer.
1015
10162012-09-19 Stephen Berman <stephen.berman@gmx.net>
1017
1018 Changes from 2011-12-02 (revision 109997).
1019 * calendar/todos.el: Remove old commentary from todo-mode.el; add
1020 and revise further doc strings and comments; require cl.el at
1021 compile time for remove-duplicates; use function powerset from
1022 http://rosettacode.org/wiki/Power_set#Common_Lisp (GFDL); further
1023 code rearrangement. Add adapted version of diary-goto-entry as comment.
1024 (todos-file-top, todos-archived-categories-buffer)
1025 (todos-save-top-priorities-too, todos-toggle-item-diary-inclusion)
1026 (todos-save-top-priorities, todos-reset-separator)
1027 (todos-switch-todos-file, todos-item-string-start, todos-counts)
1028 (todos-string-count-lines, todos-string-multiline-p)
1029 (todos-display-categories-alphabetically): Remove.
1030 (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1031 (todos-insert-item-ask-date-time-for-diary)
1032 (todos-insert-item-ask-date-time-for-diary-here)
1033 (todos-insert-item-ask-date-time-here)
1034 (todos-insert-item-ask-date-maybe-notime)
1035 (todos-insert-item-ask-date-maybe-notime-for-diary)
1036 (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1037 (todos-insert-item-ask-date-maybe-notime-here)
1038 (todos-insert-item-ask-date-for-diary)
1039 (todos-insert-item-ask-date-for-diary-here)
1040 (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1041 (todos-insert-item-ask-dayname-time)
1042 (todos-insert-item-ask-dayname-time-for-diary)
1043 (todos-insert-item-ask-dayname-time-for-diary-here)
1044 (todos-insert-item-ask-dayname-time-here)
1045 (todos-insert-item-ask-dayname-maybe-notime)
1046 (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1047 (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1048 (todos-insert-item-ask-dayname-maybe-notime-here)
1049 (todos-insert-item-ask-dayname-for-diary)
1050 (todos-insert-item-ask-dayname-for-diary-here)
1051 (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1052 (todos-insert-item-ask-time-for-diary)
1053 (todos-insert-item-ask-time-for-diary-here)
1054 (todos-insert-item-ask-time-here)
1055 (todos-insert-item-maybe-notime)
1056 (todos-insert-item-maybe-notime-for-diary)
1057 (todos-insert-item-maybe-notime-for-diary-here)
1058 (todos-insert-item-maybe-notime-here)
1059 (todos-insert-item-for-diary, todos-insert-item-for-diary-here)
1060 (todos-insert-item-here): Remove; all of these are now generated
1061 on loading (some with the same name, most with other names.)
1062 (todos-item-counts, todos-display-categories-alphabetically)
1063 (todos-display-categories-sorted-by-todo)
1064 (todos-display-categories-sorted-by-diary)
1065 (todos-display-categories-sorted-by-done)
1066 (todos-display-categories-sorted-by-archived): Comment out.
1067 (todos-comment-string, todos-mode-line-function)
1068 (todos-filter-function, todos-priorities-rules)
1069 (todos-visit-files-commands, todos-categories-totals-label)
1070 (todos-use-only-highlighted-region, todos-diary-nonmarking):
1071 New defcustoms.
1072 (todos-mark, todos-comment): New faces.
1073 (todos-comment-face): Corresponding new variable.
1074 (todos-categories-full, todos-global-current-todos-file)
1075 (todos-first-visit, todos-insertion-commands-args-genlist)
1076 (todos-insertion-commands-args, todos-insertion-commands-names)
1077 (todos-insertion-commands, todos-insertion-commands-arg-key-list)
1078 (todos-top-priorities-widgets, todos-date-from-calendar)
1079 (todos-item-mark, todos-categories-with-marks): New variables.
1080 (todos-mode-line-control, todos-reset-global-current-todos-file)
1081 (todos-gen-arglists, todos-insertion-command-name)
1082 (todos-insertion-key-bindings, todos-unload-hook)
1083 (todos-filter-items, todos-set-date-from-calendar)
1084 (todos-comment-string-matcher, todos-after-find-file)
1085 (todos-reset-nondiary-marker, todos-reset-done-string)
1086 (todos-reset-comment-string, todos-show-current-file)
1087 (todos-item-marked-p, todos-total-item-counts): New functions.
1088 (todos-define-insertion-command): New macro.
1089 (todos-toggle-mark-item, todos-mark-category)
1090 (todos-unmark-category, todos-set-top-priorities)
1091 (todos-merged-diary-items, todos-regexp-items)
1092 (todos-merged-regexp-items, todos-custom-items)
1093 (todos-merged-custom-items, todos-comment-done-item)
1094 (todos-archive-category-done-items, todos-unarchive-items)
1095 (todos-print-to-file): New commands.
1096 (todos-done-separator): Change :set function.
1097 (todos-done-string): Uncomment :initialize and :set functions.
1098 (todos-files): Use file-truename.
1099 (todos-show-current-file): Rename from
1100 todos-auto-switch-todos-file and change :set function accordingly.
1101 (todos-font-lock-keywords): Use todos-comment-string-matcher;
1102 change names of other matcher functions to new *-matcher.
1103 (todos-category-number): Change initial value.
1104 (todos-insertion-map): Use todos-insertion-key-bindings to
1105 generate key definitions.
1106 (todos-mode-map): Don't suppress digit keys, so they can supply
1107 prefix arguments; add new and change some existing bindings.
1108 (todos-archive-mode-map): Change a key binding.
1109 (todos-categories-mode-map): Comment out a key binding.
1110 (todos-filter-items-mode-map): Rename from
1111 todos-top-priorities-mode-map.
1112 (todos-mode): Make todos-current-todos-file,
1113 todos-categories-full, todos-categories, todos-first-visit,
1114 todos-category-number, todos-show-done-only,
1115 todos-categories-with-marks local variables and set them; add
1116 todos-show-current-file to pre-command-hook, todos-after-find-file
1117 to post-command-hook and todos-reset-global-current-todos-file to
1118 kill-buffer-hook.
1119 (todos-archive-mode): Make todos-current-todos-file,
1120 todos-categories and todos-category-number local variables and set
1121 them; add todos-after-find-file to post-command-hook.
1122 (todos-raw-mode): New derived major mode.
1123 (todos-categories-mode): Don't set font-lock-defaults and
1124 buffer-read-only; make todos-current-todos-file and
1125 todos-categories local variables and set them.
1126 (todos-filter-items-mode): Rename from todos-top-priorities-mode-map.
1127 (todos-quit): Don't reset todos-categories on quitting
1128 todos-categories-mode; handle quitting todos-filter-items-mode.
1129 (todos-show): Simplify; when visiting an archive file switch to
1130 corresponding Todos file; use todos-first-visit.
1131 (todos-view-archived-items): Simplify; call todos-category-number.
1132 (todos-show-archive): Rename from todos-switch-to-archive and
1133 adjust callers; simplify.
1134 (todos-toggle-display-date-time): Add optional argument to toggle
1135 display in entire file.
1136 (todos-top-priorities): Use todos-filter-items, which now contains
1137 the previous core of this command.
1138 (todos-merged-top-priorities, todos-diary-items):
1139 Use todos-filter-items.
1140 (todos-forward-category): Add optional argument to go to the
1141 previous category.
1142 (todos-backward-category): Use todos-forward-category.
1143 (todos-jump-to-category): Refine implementation.
1144 (todos-forward-item, todos-backward-item): Fix movement from todo
1145 to done item and vice versa.
1146 (todos-add-file): Remove argument and simplify.
1147 (todos-rename-category): Use todos-current-todos-file and
1148 todos-mode-line-function; set todos-categories with
1149 todos-set-categories.
1150 (todos-delete-category): Ask what to do if category has archived items.
1151 (todos-raise-category): Ensure modified todos-categories is added
1152 to file's categories sexp.
1153 (todos-move-category): Improve implementation, especially handling
1154 of archived categories.
1155 (todos-merge-category): Tweak; set item counts.
1156 (todos-insert-item): Improve handling of various argument values;
1157 add new argument values to control marking of diary items and to
1158 use region for item body.
1159 (todos-insert-item-from-calendar): Use todos-global-current-todos-file.
1160 (todos-delete-item, todos-edit-item-header): Handle marked items.
1161 (todos-edit-item): Incorporate functionality of removed
1162 todos-string-multiline-p.
1163 (todos-edit-multiline): Use set-window-buffer instead of
1164 switch-to-buffer.
1165 (todos-edit-quit): Don't save on quitting; use todos-show instead
1166 of todos-category-select.
1167 (todos-raise-item-priority): Add argument to lower priority;
1168 improve handling of top priority items in todos-filter-items-mode;
1169 restore marks.
1170 (todos-lower-item-priority): Use todos-raise-item-priority.
1171 (todos-set-item-priority): Increment maximum number if item is new.
1172 (todos-move-item): Handle marked items; delay changing category
1173 moved from till after movement to avoid restoring if user cancels
1174 before insertion.
1175 (todos-item-done): Add optional argument to insert comment; fix
1176 item counts and update sexp.
1177 (todos-item-undo): Fix item counts and update.
1178 (todos-archive-done-item-or-items): Rename from
1179 todos-archive-done-items; add optional argument to archive all
1180 items in category; handle marked items.
1181 (todos-unarchive-category): Use todos-unarchive-items.
1182 (todos-toggle-diary-inclusion): Incorporate functionality of
1183 removed todos-toggle-item-diary-inclusion; handle marked items.
1184 (todos-print): Add optional argument to print to file.
1185 (todos-done-string-start): Don't use todos-nondiary-start.
1186 (todos-date-string-matcher, todos-time-string-matcher)
1187 (todos-done-string-matcher, todos-category-string-matcher): Rename
1188 from *-match and adjust callers.
1189 (todos-wrap-and-indent): Use set instead of setq for local variables.
1190 (todos-prefix-overlays): Improve overlay handling.
1191 (todos-reset-categories): Fix and complete implementation.
1192 (todos-toggle-show-current-file): Rename from
1193 todos-toggle-switch-todos-file-noninteractively.
1194 (todos-category-select): Use todos-mode-line-function.
1195 (todos-item-start): Comment out code used by removed function.
1196 (todos-remove-item): Handle presence of both prefix/number and
1197 mark overlays.
1198 (todos-get-count): Simplify.
1199 (todos-set-count): Change argument list and adjust callers; simplify.
1200 (todos-set-categories): Handle new archive files; use
1201 todos-categories-full and todos-ignore-archived-categories.
1202 (todos-truncate-categories-list): Use todos-categories-full.
1203 (todos-update-categories-sexp): Use kill-region instead of
1204 kill-line; use todos-categories-full.
1205 (todos-read-file-name): Add argument to require existing file and
1206 adjust callers; use file-truename.
1207 (todos-read-category): Remove argument to require existing
1208 category and delegate it to completing-read in function body.
1209 (todos-validate-category-name): Make empty string prompt only for
1210 initial category name.
1211 (todos-read-date): Use = instead of eq for testing if month = 13,
1212 and if it is, set monthname to *.
1213 (todos-display-categories): Use todos-global-current-todos-file;
1214 use set-window-buffer instead of switch-to-buffer; add a line
1215 showing item count totals.
1216 (todos-padded-string): Use the longest of category name or label.
1217 (todos-descending-counts): Rename from
1218 todos-descending-counts-store and adjust users.
1219 (todos-insert-category-line): Adjust format; use mapconcat; kill
1220 buffer after jumping to category.
1221
12222012-09-18 Stephen Berman <stephen.berman@gmx.net>
1223
1224 Changes from 2011-05-16 (revision 109996).
1225 * calendar/todos.el Add and revise various doc strings, remove
1226 further commented out code; add further comments; further code
1227 rearrangement.
1228 (todos-file-do, todos-archive-file, todos-mode-hook)
1229 (todos-edit-mode-hook, todos-exclusion-start, todos-exclusion-end)
1230 (todos-view-archive, todos-search-string)
1231 (todos-jump-to-category-noninteractively, todos-initial-setup):
1232 Remove.
1233 (todos-files): Remove this defcustom.
1234 (todos-initial-category, todos-display-categories-first)
1235 (todos-auto-switch-todos-file, todos-default-todos-file)
1236 (todos-categories-category-label, todos-categories-todo-label)
1237 (todos-categories-diary-label, todos-categories-done-label)
1238 (todos-categories-archived-label)
1239 (todos-categories-number-separator, todos-categories-align)
1240 (todos-ignore-archived-categories, todos-nondiary-marker):
1241 New defcustoms.
1242 (todos-prefix, todos-done-separator, todos-file-top)
1243 (todos-categories-buffer, todos-archived-categories-buffer)
1244 (todos-edit-buffer, todos-always-add-time-string, todos-button):
1245 Change default value.
1246 (todos-done-string): Add todos-reset-done-string as :set function,
1247 but keep this commented out.
1248 (todos-files, todos-archives, todos-insertion-map)
1249 (todos-category-done, todos-nondiary-start, todos-nondiary-end)
1250 (todos-show-done-only, todos-date-string-start)
1251 (todos-done-string-start): New variables.
1252 (todos-files-directory, todos-files-function, todos-merged-files)
1253 (todos-prompt-merged-files, todos-files, todos-modes-set-1)
1254 (todos-modes-set-2, todos-reset-done-string, todos-reset-categories)
1255 (todos-toggle-switch-todos-file-noninteractively)
1256 (todos-switch-todos-file, todos-counts, todos-get-count)
1257 (todos-set-count, todos-set-categories)
1258 (todos-truncate-categories-list, todos-update-categories-sexp)
1259 (todos-read-file-name, todos-sort, todos-display-sorted)
1260 (todos-label-to-key, todos-insert-sort-button): New functions.
1261 (todos-display-categories-sorted-by-todo)
1262 (todos-display-categories-sorted-by-diary)
1263 (todos-display-categories-sorted-by-done)
1264 (todos-display-categories-sorted-by-archived)
1265 (todos-update-merged-files, todos-switch-to-archive)
1266 (todos-choose-archive, todos-merged-top-priorities)
1267 (todos-jump-to-category-other-file, todos-clear-matches)
1268 (todos-add-file, todos-change-default-file, todos-move-category)
1269 (todos-merge-category, todos-merge-categories)
1270 (todos-edit-item-time, todos-move-item-to-file)
1271 (todos-unarchive-category, todos-toggle-item-diary-nonmarking)
1272 (todos-toggle-diary-nonmarking): New commands.
1273 (todos-toggle-show-done-only): New command replacing todos-view-archive.
1274 (todos-faces): New defgroup; use in all face definitions.
1275 (todos-sorted-column, todos-archived-only, todos-search): New faces.
1276 (todos-font-lock-keywords): Use subexpression 1 with matcher
1277 todos-category-string-match.
1278 (todos-mode-map, todos-archive-mode-map, todos-edit-mode-map)
1279 (todos-categories-mode-map): Add new key bindings; change some
1280 existing bindings.
1281 (todos-top-priorities-mode-map): New keymap.
1282 (todos-menu): Add submenues and new entries.
1283 (auto-mode-alist): Add extension of Todos and Todos archive files.
1284 (todos-mode, todos-archive-mode): Make derived mode; use
1285 todos-modes-set-1, todos-modes-set-2, todos-auto-switch-todos-file
1286 and todos-switch-todos-file; make todos-show-done-only local
1287 variable.
1288 (todos-edit-mode): Make derived mode; use todos-modes-set-1.
1289 (todos-categories-mode): Make derived mode.
1290 (todos-top-priorities-mode): New derived major mode.
1291 (todos-save): Remove unused code.
1292 (todos-quit): Handle todos-categories-mode; save archive buffer.
1293 (todos-show): Add optional argument to prompt for a Todos file; if
1294 called interactively or with prefix arg or from an archive, don't
1295 make a no-op but reset todos-current-todos-file, todos-categories
1296 and todos-category-number; use todos-read-file-name,
1297 todos-display-categories-first, todos-ignore-archived-categories.
1298 (todos-display-categories): Change argument name; refactor code
1299 for inserting table labels and lines, using
1300 todos-ignore-archived-categories, todos-sort,
1301 todos-categories-number-separator, todos-insert-sort-button,
1302 todos-categories-*-labels, and todos-insert-category-line.
1303 (todos-display-categories-alphabetically): Use todos-display-sorted.
1304 (todos-toggle-view-done-items): Use todos-done-string-start and
1305 todos-get-count.
1306 (todos-toggle-display-date-time): Use todos-done-string-start.
1307 (todos-top-priorities): Remove autoload cookie; partially rewrite:
1308 new argument list; allow combining top priorities of multiple
1309 Todos files; change display to include category (and file) name as
1310 part of item header; use todos-top-priorities-mode.
1311 (todos-diary-items): Reimplement using only todos-top-priorities.
1312 (todos-forward-category, todos-backward-category): Adjust to
1313 1-based numbering of categories; move point to top of category.
1314 (todos-jump-to-category): Rewrite, adding optional arguments to
1315 provide a category in non-interactive uses and to prompt for which
1316 Todos file to jump to.
1317 (todos-search): Reimplement; highlight each match as found, say
1318 how many matches remain and prompt whether to go to next one; at
1319 end of search prompt whether to remove highlighting.
1320 (todos-add-category): Remove autoload cookie; assign new category
1321 the highest category number; associate zero-initialized vector of
1322 item counts, instead of property list, with new category; use
1323 todos-validate-category-name and todos-update-categories-sexp.
1324 (todos-rename-category): Use todos-validate-category-name and
1325 todos-update-categories-sexp; take archive files into account.
1326 (todos-delete-category): Use todos-get-count and
1327 todos-update-categories-sexp, let-bind variable that were
1328 mistakenly global; use delete-region instead of kill-region;
1329 adjust to 1-based numbering of categories; move point to top of
1330 category.
1331 (todos-raise-category): Handle item count vectors; use
1332 todos-insert-category-line and todos-update-categories-sexp.
1333 (todos-insert-item): Use nil time-string argument to omit time
1334 string; use todos-nondiary-start and todos-nondiary-end and
1335 todos-update-categories-sexp; if category named to insert into
1336 does not exist, add it; take new diary items into account.
1337 (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1338 (todos-insert-item-ask-date-time-for-diary)
1339 (todos-insert-item-ask-date-time-for-diary-here)
1340 (todos-insert-item-ask-date-time-here)
1341 (todos-insert-item-ask-date-maybe-notime)
1342 (todos-insert-item-ask-date-maybe-notime-for-diary)
1343 (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1344 (todos-insert-item-ask-date-maybe-notime-here)
1345 (todos-insert-item-ask-date-for-diary)
1346 (todos-insert-item-ask-date-for-diary-here)
1347 (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1348 (todos-insert-item-ask-dayname-time)
1349 (todos-insert-item-ask-dayname-time-for-diary)
1350 (todos-insert-item-ask-dayname-time-for-diary-here)
1351 (todos-insert-item-ask-dayname-time-here)
1352 (todos-insert-item-ask-dayname-maybe-notime)
1353 (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1354 (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1355 (todos-insert-item-ask-dayname-maybe-notime-here)
1356 (todos-insert-item-ask-dayname-for-diary)
1357 (todos-insert-item-ask-dayname-for-diary-here)
1358 (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1359 (todos-insert-item-ask-time-for-diary)
1360 (todos-insert-item-ask-time-for-diary-here)
1361 (todos-insert-item-ask-time-here)
1362 (todos-insert-item-maybe-notime)
1363 (todos-insert-item-maybe-notime-for-diary)
1364 (todos-insert-item-maybe-notime-for-diary-here)
1365 (todos-insert-item-maybe-notime-here)
1366 (todos-insert-item-for-diary, todos-insert-item-for-diary-here):
1367 New insertion commands.
1368 (todos-insert-item-from-calendar): Use todos-current-todos-file.
1369 (todos-delete-item): Handle diary items;
1370 use todos-update-categories-sexp.
1371 (todos-edit-item): Check if point is with item string;
1372 use read-string instead of read-from-minibuffer;
1373 use todos-date-string-start; after editing put point at start of
1374 item text.
1375 (todos-edit-multiline): Narrow to item before invoking
1376 todos-edit-mode; show key binding of todos-edit-quit in a message.
1377 (todos-edit-quit): Use todos-save; kill buffer.
1378 (todos-edit-item-header): Add optional argument to prompt for
1379 editing only date string or only time string;
1380 use todos-date-string-start.
1381 (todos-edit-item-date, todos-edit-item-date-is-today)
1382 (todos-raise-item-priority, todos-lower-item-priority): Rename
1383 from todos-{raise, lower}-item and make them DTRT in
1384 todos-top-priorities-mode.
1385 (todos-set-item-priority): Make interactive; use todos-get-count
1386 and todos-insert-with-overlays; interactively, just relocate the
1387 item within its category.
1388 (todos-move-item): Add optional argument to prompt for a category
1389 in another Todos file; handle diary items; fix restoration after
1390 cancelling before inserting.
1391 (todos-item-done): Handle diary items; simplify handling of
1392 insertion in done items section.
1393 (todos-item-undo): Handle diary items.
1394 (todos-archive-done-items): Adjust to new handling of archive
1395 files (in parallel with Todos files); handle diary items; use
1396 todos-done-string-start.
1397 (todos-toggle-item-diary-inclusion): Use todos-nondiary-start,
1398 todos-nondiary-end and todos-item-counts.
1399 (todos-toggle-diary-inclusion): Use todos-category-done instead of
1400 todos-category-end.
1401 (todos-print): Remove autoload cookie; rewrite to make overlays,
1402 line wrapping and wrap prefixes printable.
1403 (todos-date-pattern): Make parenthesized groups shy.
1404 (todos-date-string-match): Use todos-date-string-start; make
1405 todos-date-pattern an explicitly numbered group.
1406 (todos-time-string-match): Use todos-date-string-start.
1407 (todos-done-string-match): Use todos-done-string-start.
1408 (todos-category-string-match): Rewrite to match new category and
1409 category+filename patterns in todos-top-priorities-mode.
1410 (todos-prefix-overlays): Use todos-done-string-start and
1411 todos-category-done.
1412 (todos-reset-prefix): Handle archive files; restore point after
1413 changing prefix.
1414 (todos-reset-separator): Handle archive files.
1415 (todos-category-number): Make category number one more than its
1416 list index.
1417 (todos-current-category): Adjust to 1-based numbering of categories.
1418 (todos-category-select): Simplify handling of done items and done
1419 separator string overlay.
1420 (todos-item-start): Use todos-date-string-start and
1421 todos-done-string-start.
1422 (todos-item-start, todos-item-end): Fix wrong parenthesizing.
1423 (todos-item-string): Restore point after getting item bounds; use
1424 buffer-substring-no-properties.
1425 (todos-done-item-p): Use todos-done-string-start.
1426 (todos-make-categories-list): Add optional argument to force
1427 looping through file to get categories and their item counts,
1428 otherwise set todos-categories from sexp in first line; use
1429 vectors of item counts instead of plists; count diary items.
1430 (todos-item-counts): Use todos-counts, todos-set-counts,
1431 todos-get-counts, and todos-update-categories-sexp instead of
1432 getting and setting properties; handle diary items.
1433 (todos-read-category): Add argument to set prompt; don't offer
1434 default category.
1435 (todos-validate-category-name): Rename from
1436 todos-check-category-name; take into account whether there are
1437 already categories or not.
1438 (todos-read-date): Accept `*' as an unspecified month, day, or year.
1439 (todos-padded-string): Accommodate new structure of
1440 todos-categories as alists; use todos-categories-align.
1441 (todos-descending-counts-store): New variable.
1442 (todos-insert-category-line): Rename from
1443 todos-insert-category-name and reimplement using labels and
1444 todos-get-counts instead of properties; use
1445 todos-ignore-archived-categories; highlight sorted column.
1446
14472012-09-14 Stephen Berman <stephen.berman@gmx.net>
1448
1449 Changes from 2010-07-09 (revision 109995).
1450 * calendar/todos.el Remove lots of commented out code; add various
1451 comments; further code rearrangement.
1452 (todos-insert-item-here-ask-date-time)
1453 (todos-insert-item-ask-date-time)
1454 (todos-insert-item-ask-dayname-time)
1455 (todos-insert-item-for-diary)
1456 (todos-insert-item-for-diary-ask-date-time)
1457 (todos-make-categories-alist, todos-categories-alist): Remove.
1458 (todos-categories-list): Comment out.
1459 (todos-make-categories-list): New function replacing
1460 todos-make-categories-alist, using category plists to get item
1461 counts and taking archive into account.
1462 (todos-current-todos-file): New variable.
1463 (todos-mode-map): Update key bindings.
1464 (todos-save): Add as comment code to make sure todos-categories
1465 sexp is current on saving.
1466 (todos-quit): Call todos-show on quitting Todos archive buffer.
1467 (todos-show): If todos-current-todos-file is not set to Todos
1468 file, set it as a new file; set todos-categories from
1469 todos-make-categories-alist.
1470 (todos-display-categories): Use a different display format for
1471 archive file; put point initially on the first button.
1472 (todos-toggle-view-done-items): Check the category's `done'
1473 property to determine if there are done items.
1474 (todos-view-archive): Set todos-current-todos-file to the archive
1475 file; jump from the Todos file to the same category in the
1476 archive, if it exists, else jump to the first category; use
1477 message instead of error.
1478 (todos-add-category): Intern a special symbol for the new category
1479 and set its property list to holds counts of the numbers of todo,
1480 done and archived items in the category; assign the new category
1481 the current highest category number.
1482 (todos-rename-category): Don't use todos-categories-alist.
1483 (todos-delete-category): Check the category's `todo' and `done'
1484 properties to determine if it is empty; ensure that the end of the
1485 last category is found; after deleting the category, empty its
1486 plist and unintern its special symbol.
1487 (todos-insert-item-here): Fix argument list of todos-insert-item.
1488 (todos-delete-item, todos-raise-item, todos-lower-item):
1489 Use message instead of error.
1490 (todos-move-item): If the category to be moved to does not exist,
1491 add it as a new category.
1492 (todos-item-done, todos-reset-separator):
1493 Use todos-category-select instead of todos-show.
1494 (todos-archive-done-items): Make buffer writeable; conditionalize
1495 search for end of category; save after adding to archive in case
1496 the file is new, so it can be found.
1497 (todos-category-select): Wrap search in if instead of or+and;
1498 don't hide done items in an archive.
1499 (todos-set-item-priority): Check the category's `todo'
1500 property to determine if there are not done todo items.
1501 (todos-jump-to-category-noninteractively): Just switch to buffer
1502 visiting todos-current-todos-file, since this can be either a
1503 Todos file or an archive.
1504 (todos-item-counts): Use category's plist instead of an alist.
1505 (todos-longest-category-name-length): Argument is now a list of
1506 category names, not an alist, so just test each element, not each
1507 element's the car.
1508 (todos-padded-string): Use todos-categories instead of
1509 todos-categories-alist.
1510 (todos-insert-category-name): Use category plist to get item
1511 counts; take archived items into account.
1512
15132012-09-13 Stephen Berman <stephen.berman@gmx.net>
1514
1515 Changes from 2010-06-18 (revision 109994).
1516 * calendar/todos.el: Numerous spelling and comment fixes, doc
1517 string fixes to conform with checkdoc, further rearrangement of
1518 definitions, etc.
1519 (todos-previous-line, todos-previous-answer)
1520 (todos-insert-item-ask-date, todos-change-date)
1521 (todos-date-nodayname-pattern, todos-dayname-date-pattern)
1522 (todos-count-items-in-category, todos-count-all-items): Remove.
1523 (todos-update-numbered-prefix, todos-item-start-overlays)
1524 (todos-add-item-non-interactively): Comment out, also in uses.
1525 (todos-done-separator): Change default value.
1526 (todos-always-add-time-string): Rename from todos-add-time-string
1527 and adjust uses.
1528 (todos-read-category): Rename from todos-completing-read and
1529 adjust callers; use todos-current-category.
1530 (todos-make-categories-alist): Rename from function
1531 todos-categories-alist.
1532 (todos-categories-alist): New variable.
1533 (todos-indent-to-here): New defcustom.
1534 (todos-button): New face.
1535 (todos-display-categories-alphabetically, todos-raise-category)
1536 (todos-lower-category, todos-insert-item-for-diary-ask-date-time)
1537 (todos-insert-item-here-ask-date-time)
1538 (todos-insert-item-ask-date-time)
1539 (todos-insert-item-ask-dayname-time): New commands.
1540 (todos-edit-item-header): New command replacing todos-change-date.
1541 (todos-category-number, todos-indent, todos-item-counts)
1542 (todos-check-category-name, todos-read-date, todos-read-dayname)
1543 (todos-read-time, todos-padded-string)
1544 (todos-insert-category-name): New functions.
1545 (todos-set-item-priority): New function replacing
1546 todos-add-item-non-interactively.
1547 (todos-mode-map): Remap newline to newline-and-indent.
1548 (todos-edit-mode-map): Make sparse keymap; remap newline to
1549 newline-and-indent.
1550 (todos-categories-mode-map): New keymap.
1551 (todos-mode, todos-edit-mode): Make indent-line-function local
1552 variable and set to todos-indent.
1553 (todos-categories-mode): New major mode.
1554 (todos-display-categories): List categories initially in their
1555 numerical order; add optional argument to switch to alphabetical
1556 listing.
1557 (todos-toggle-view-done-items): Simplify implementation.
1558 (todos-toggle-display-date-time): Fix regexp search string.
1559 (todos-backward-item, todos-forward-item): Use variable
1560 todos-item-start.
1561 (todos-add-category): Use todos-check-category-name and
1562 todos-categories-alist.
1563 (todos-rename-category): Use todos-current-category,
1564 todos-check-category-name and todos-categories-alist.
1565 (todos-delete-category): Use todos-check-category-name and
1566 todos-categories-alist and take done items into account.
1567 (todos-insert-item): Use separate arguments to handle insertion of
1568 date/dayname and time strings, add new argument to mark item for
1569 diary inclusion, use new todos-read-* functions,
1570 todos-set-item-priority and todos-item-counts.
1571 (todos-insert-item-here, todos-insert-item-for-diary)
1572 (todos-insert-item-from-calendar): Adapt to new version of
1573 todos-insert-item.
1574 (todos-delete-item, todos-item-done): Use todos-item-counts.
1575 (todos-edit-item): Indent newlines inserted by C-q C-j if nonspace
1576 char follows.
1577 (todos-lower-item): Ensure only not-done items can be lowered.
1578 (todos-move-item): Use todos-current-category, todos-read-category
1579 and todos-item-counts.
1580 (todos-archive-done-items): Use todos-current-category and
1581 todos-item-counts; fix regexp search string.
1582 (todos-item-undo): Use todos-current-category,
1583 todos-set-item-priority, todos-insert-with-overlays and
1584 todos-item-counts; restore if user quits before inserting undone
1585 item.
1586 (todos-date-pattern): Rewrite without using
1587 todos-date-nodayname-pattern and todos-dayname-date-pattern.
1588 (todos-date-string-match): Do not make todos-date-pattern an
1589 unnumbered group.
1590 (todos-time-string-match): Make todos-date-pattern a shy group.
1591 (todos-wrap-and-indent): Use todos-indent-to-here.
1592 (todos-reset-prefix): Revert to using todos-show instead of
1593 todos-category-select.
1594 (todos-prefix-overlays): Fix numbering of done items and updating
1595 of prefix.
1596 (todos-category-select): Use todos-current-category; fix display
1597 of separator string; don't move point to top of category.
1598 (todos-jump-to-category-noninteractively): Use todos-category-number.
1599 (todos-insert-with-overlays): Use todos-item-start unconditionally.
1600 (todos-item-start): New variable.
1601 (todos-item-start): Use it to define this function.
1602 (todos-item-end): Adjust if item is last unfinished one before
1603 displayed done items.
1604 (todos-remove-item): Use todos-item-start and todos-item-end
1605 instead of todos-forward-item and todos-backward-item.
1606 (todos-longest-category-name-length): Add argument for list of
1607 categories.
1608
16092012-09-13 Stephen Berman <stephen.berman@gmx.net>
1610
1611 Changes from 2010-05-25 (revision 109993).
1612 * calendar/todos.el: Comment out calendar require, since diary-lib
1613 requires calendar. Rearrange file to group definitions according
1614 to their use (types of commands, internal functions, etc.)
1615 (todos-file-done, todos-insert-threshold, todos-remove-separator)
1616 (todos-date-string, todos-time-string, todos-check-overlay)
1617 (todos-show-paren-hack, todos-file-item, todos-more-important-p):
1618 Comment out.
1619 (todos-current-date, todos-item-end-overlays)
1620 (todos-list-categories): Remove.
1621 (todos-item-end): Remove (the variable, not the function).
1622 (todos-prefix-overlays): Rename from todos-item-overlays and adjust
1623 callers.
1624 (todos-done-separator, todos-done-string, todos-show-with-done)
1625 (todos-files, todos-archive-file, todos-categories-buffer)
1626 (todos-archived-categories-buffer, todos-wrap-lines)
1627 (todos-line-wrapping-function): New defcustoms.
1628 (todos-done, todos-done-sep): New faces.
1629 (todos-done-face, todos-done-sep-face): Corresponding new variables.
1630 (todos-search-string, todos-date-nodayname-pattern)
1631 (todos-dayname-date-pattern, todos-date-pattern): New variables.
1632 (todos-done-string-match, todos-category-string-match)
1633 (todos-check-format, todos-wrap-and-indent, todos-reset-separator)
1634 (todos-current-category, todos-count-items-in-category)
1635 (todos-done-item-p, todos-categories-alist, todos-count-all-items)
1636 (todos-longest-category-name-length): New functions.
1637 (todos-categories-list): New buffer-specific function replacing
1638 todos-list-categories.
1639 (todos-toggle-item-numbering, todos-toggle-view-done-items)
1640 (todos-search, todos-view-archive, todos-diary-items)
1641 (todos-toggle-display-date-time, todos-insert-item-no-time)
1642 (todos-insert-item-ask-date, todos-insert-item-for-diary)
1643 (todos-insert-item-from-calendar, todos-edit-quit)
1644 (todos-change-date, todos-item-done, todos-archive-done-items)
1645 (todos-item-undo): New commands.
1646 (todos-archive-mode): New major mode.
1647 (todos-archive-mode-map, todos-edit-mode-map): New keymaps.
1648 (todos-category-beg): Change value.
1649 (todos-number-prefix): Change default value.
1650 (todos-edit-buffer): Change from defvar to defcustom.
1651 (todos-font-lock-keywords): Use todos-done-string-match and
1652 todos-category-string-match.
1653 (todos-backward-item, todos-forward-item): Use todos-done-string
1654 and todos-date-pattern.
1655 (todos-display-categories): Reimplement using buttons from
1656 button.el instead of widgets.
1657 (todos-top-priorities): Use with-current-buffer; take done items
1658 into account; ensure buffers gets fontified.
1659 (todos-add-category): Ensure new category does not begin with
1660 empty lines.
1661 (todos-jump-to-category): Use todos-category-select instead of
1662 todos-show.
1663 (todos-rename-category): Prompt for new name in body instead of in
1664 interactive spec.
1665 (todos-insert-item): Don't insert in done items section of
1666 category. Add two optional arguments to control insertion: (i) to
1667 insert near point without prompting for priority; (ii) to use
1668 defaults for date and time strings, to prompt for these, or to
1669 choose date from the Calendar.
1670 (todos-insert-item-here): Reimplement using todos-insert-item.
1671 (todos-delete-item): Don't move point after deleting last item.
1672 (todos-raise-item, todos-lower-item): Take done items into account.
1673 (todos-move-item): Don't move done items; update item numbering;
1674 restore if user quits before inserting moved item.
1675 (todos-print): Prompt for confirmation to print.
1676 (todos-reset-prefix): Search backward from end of file instead of
1677 forward from top.
1678 (todos-jump-to-category-noninteractively): Take Todos archive into
1679 account.
1680 (todos-category-select): Show or hide done items according to
1681 todos-show-with-done; if shown, coordinate separator and prefix
1682 overlays.
1683 (todos-add-item-non-interactively): Replace binary insertion
1684 algorithm with prompting for numerical priority.
1685 (todos-insert-with-overlays): Remove use of variable todos-item-end.
1686 (todos-item-start): Take done items into account; use
1687 todos-date-pattern.
1688 (todos-item-end): Reimplement using todos-forward-item.
1689 (todos-remove-item): Reimplement using todos-forward-item and
1690 todos-backward-item; redo overlay handling.
1691 (todos-mode-map): Add some new key bindings and change numerous
1692 existing bindings; use "i" as prefix key for item insertion
1693 commands.
1694 (todos-mode): Use todos-wrap-lines and delegate word-wrap and
1695 wrap-prefix settings to todos-wrap-and-indent; add to invisibility
1696 spec; set buffer-read-only to t and consequently let-bind this
1697 variable in all Todos commands that change buffer content.
1698 (todos-edit-mode): Make an indepent mode, not derived from text-mode.
1699 (todos-save): Don't save top priorities buffer.
1700 (todos-show): Make a no-op if called interactively in narrowed
1701 Todos mode, since, also to work around item prefix reduplication
1702 bug with show-paren-mode enabled; use todos-categories-list.
1703
17042012-09-12 Stephen Berman <stephen.berman@gmx.net>
1705
1706 Changes from 2009-11-07 (revision 109992).
1707 * calendar/todos.el: Comment out time-stamp require; require
1708 calendar and diary-lib.
1709 (todos-prefix): Change default value and doc string to reflect new
1710 meaning; add :initialize and :set functions.
1711 (todos-time-string-format, todos-entry-prefix-function)
1712 (todos-initials, todos-entry-timestamp-initials)
1713 (todos-prefix-face, todos-category-sep, todos-category-end)
1714 (todos-cp): Comment out.
1715 (todos-prefix-string): Inherit from font-lock-comment-face.
1716 (todos-item-header, todos-item-header-face): Remove.
1717 (todos-date, todos-time): New faces.
1718 (todos-date-face, todos-time-face): Corresponding new variables.
1719 (todos-add-time-string, todos-include-in-diary)
1720 (todos-exclusion-start, todos-exclusion-end, todos-number-prefix):
1721 New defcustoms.
1722 (todos-item-end, todos-item-start-overlays)
1723 (todos-item-end-overlays): New variables.
1724 (todos-date-string-match, todos-time-string-match): New functions.
1725 (todos-font-lock-keywords): Use them.
1726 (todos-current-date, todos-date-string, todos-time-string)
1727 (todos-toggle-item-diary-inclusion, todos-toggle-diary-inclusion)
1728 (todos-reset-prefix, todos-update-numbered-prefix)
1729 (todos-check-overlay, todos-item-overlays)
1730 (todos-insert-with-overlays, todos-show-paren-hack): New functions.
1731 (todos-highlight-item): New command.
1732 (todos-category-beg): Change value.
1733 (todos-category-select): Use todos-category-beg and todos-item-overlays.
1734 (todos-backward-item): Add optional count argument; use it and
1735 todos-item-start.
1736 (todos-forward-item): Use todos-check-overlay, todos-item-start
1737 and variable todos-item-end.
1738 (todos-edit-item, todos-delete-item): Use todos-number-prefix,
1739 todos-update-numbered-prefix, todos-item-overlays.
1740 (todos-add-category, todos-rename-category)
1741 (todos-list-categories): Use new category format.
1742 (todos-delete-category): Allow deleting non-empty category;
1743 use new category format.
1744 (todos-add-item-non-interactively): Comment out unnecessary
1745 save-excursion; use todos-insert-with-overlays.
1746 (todos-insert-item): Comment out unnecessary save-excursion; use
1747 new item format for date/time header and diary inclusion marking.
1748 (todos-insert-item-here): Use new item format for date/time header
1749 and diary inclusion marking; use todos-insert-with-overlays.
1750 (todos-raise-item): Make a no-op if point is on an empty line; use
1751 todos-insert-with-overlays.
1752 (todos-lower-item): Use todos-insert-with-overlays.
1753 (todos-top-priorities): Move call to todos-show inside
1754 save-excursion; add save-current-buffer after save-restriction.
1755 (todos-item-start): Use variable todos-item-end.
1756 (todos-item-end): Use todos-check-overlay and variable todos-item-end.
1757 (todos-remove-item): Take item overlays into account.
1758 (todos-mode): Change calculation of wrap-prefix; make
1759 hl-line-range-function a local variable and set it to highlight
1760 todo item.
1761 (todos-show): Ensure point stays at top of category.
1762
17632012-09-12 Stephen Berman <stephen.berman@gmx.net>
1764
1765 Changes from 2009-07-04 (revision 109991).
1766 * calendar/todos.el (todos-window-configuration): Comment out.
1767 (todos-display-categories): Comment out use of
1768 todos-window-configuration; use switch-to-buffer instead of
1769 pop-to-buffer.
1770 (todos-jump-to-category-noninteractively): Comment out use of
1771 todos-window-configuration.
1772 (todos-edit-item): Don't allow editing of date/time item header.
1773 (todos-insert-item, todos-insert-item-here): Insert date/time
1774 header in front of new item string.
1775 (todos-mode): Tweak wrap-prefix.
1776
17772012-09-12 Stephen Berman <stephen.berman@gmx.net>
1778
1779 Changes from 2009-06-26 (revision 109989).
1780 * calendar/todos.el (todos-file-do, todos-file-done):
1781 Change default location to directory "~/.emacs.d/".
1782 (todos-completion-ignore-case, todos-categories-buffer):
1783 New defcustoms.
1784 (todos-prefix-string, todos-item-header): New faces.
1785 (todos-prefix-face, todos-item-header-face): Corresponding
1786 new variables.
1787 (todos-rename-category, todos-delete-category)
1788 (todos-display-categories, todos-move-item): New commands.
1789 (todos-mode-map): Add key bindings for new commands and for
1790 todos-add-category, which had no key binding.
1791 (todos-jump-to-category-noninteractively): New function.
1792 (todos-top-priorities): Comment out code using a previously
1793 deleted variable.
1794 (todos-completing-read): Allow SPC to insert a space when entering
1795 a new category name; use todos-completion-ignore-case.
1796 (todos-font-lock-keywords, todos-window-configuration):
1797 New variables.
1798 (todos-mode): Make mode-name "TODOS"; make font-lock-defaults,
1799 word-wrap, and wrap-prefix local variables.
1800
18012012-09-12 Stephen Berman <stephen.berman@gmx.net>
1802
1803 Changes from 2009-02-16 (revision 109988).
1804 * calendar/todos.el (todos-list-categories): Fix typos.
1805 (todos-show): Ensure file is in todos-mode.
1806
18072012-09-12 Stephen Berman <stephen.berman@gmx.net>
1808
1809 Changes from 2009-02-12 (revision 109987).
1810 * calendar/todos.el (todos-header): Remove defvar.
1811 (todos-add-category): Comment out code that inserts and updates
1812 the file local variables first line of the file todos-file-do.
1813 (todos-list-categories): New function.
1814 (todos-show): Use it; remove use of a previously deleted variable.
1815
18162012-09-11 Stephen Berman <stephen.berman@gmx.net>
1817
1818 Changes from 2009-02-12 (revision 109986).
1819 * calendar/todos.el: New file. This is a copy of todo-mode.el
1820 from revision 94343 except for the following changes: replace all
1821 occurrences of the namespace prefix "todo-" with "todos-", delete
1822 the defvar todo-cats (the old name of todo-categories) and its use
1823 in todos-add-category, delete all defaliases of old command names.
1824
18252012-09-11 Bastien Guerry <bzg@gnu.org> 12012-09-11 Bastien Guerry <bzg@gnu.org>
1826 2
1827 * subr.el (set-temporary-overlay-map): Add a docstring. 3 * subr.el (set-temporary-overlay-map): Add a docstring.
diff --git a/lisp/calendar/ChangeLog b/lisp/calendar/ChangeLog
new file mode 100644
index 00000000000..d4d06352131
--- /dev/null
+++ b/lisp/calendar/ChangeLog
@@ -0,0 +1,1859 @@
12013-04-19 Stephen Berman <stephen.berman@gmx.net>
2
3 * todos.el: Extend and improve item filtering and handling of
4 saved files of filtered items.
5 (todos-show-first): Add choices for diary and regexp items.
6 (todos-absolute-file-name): Handle file names for diary and regexp
7 items.
8 (todos-filter-items): New function abstracted from item filtering
9 commands, with handling of saved files of diary and regexp items.
10 (todos-filter-items-1): Rename from todos-filter-items.
11 (todos-filtered-buffer-name): Remove, since functionality is now
12 incorporated into new function todos-filter-items.
13 (todos-filtered-items-buffer, todos-top-priorities-buffer)
14 (todos-diary-items-buffer, todos-regexp-items-buffer):
15 Make defconsts instead of defcustoms.
16 (todos-find-item): Restrict calculation and comparison of
17 priorities to top priority items, in order to handle diary and
18 regexp items.
19 (todos-check-filtered-items-file): Rename from
20 todos-check-top-priorities and adjust message and callers.
21 (todos-filter-items-filename): Rename from
22 todos-top-priorities-filename, adjusting caller and extending to
23 files of filtered diary and regexp items.
24 (todos-save-filtered-items-buffer): Rename from
25 todos-save-top-priorities-buffer and adjust caller and uses. Use
26 write-file instead of write-region and use existing file name if
27 previously saved.
28 (todos-show): Handle initially displaying saved file of filtered
29 diary or regexp items.
30 (todos-top-priorities, todos-top-priorities-multifile)
31 (todos-diary-items, todos-diary-items-multifile)
32 (todos-regexp-items, todos-regexp-items-multifile): Use new
33 function todos-filter-items.
34 (auto-mode-alist): Extend regexp for files assigned to
35 todos-filtered-items-mode to handle saved diary and regexp items.
36
372013-03-17 Stephen Berman <stephen.berman@gmx.net>
38
39 * calendar/todos.el (todos-insert-item): Fix mistake in logic of
40 here insertion from last change, and ensure category is set when
41 command is called from outside Todos buffer.
42
432013-03-15 Stephen Berman <stephen.berman@gmx.net>
44
45 * calendar/todos.el: Item unarchiving fixes and improvements.
46 (todos-archive-mode-map): Add bindings for item and category
47 marking/unmarking; make todos-display-categories binding same as
48 in Todos mode; remove todos-unarchive-category binding.
49 (todos-unarchive-category): Remove.
50 (todos-unarchive-items): Fix handling of marked items. Remove
51 code for unarchiving whole category, since that is covered by
52 unarchiving marked items. Handle unarchiving items to a category
53 that had been deleted from the todo file by re-adding the
54 category. Use todos-category-select to display restored items,
55 not todos-show. Remove obsolete or superfluous code.
56
572013-03-15 Stephen Berman <stephen.berman@gmx.net>
58
59 * calendar/todos.el (todos-reset-prefix): Don't remove overlays,
60 since it's superfluous and also wrongly removes items marks.
61 (todos-category-completions): Select current category on visiting
62 file, to ensure category is properly displayed if user switches to
63 file via a non-Todos command.
64 (todos-mark-category): Make implementation cleaner.
65 (todos-unmark-category): Improve implementation. Get overlay
66 property only when there is an overlay.
67
682013-03-14 Stephen Berman <stephen.berman@gmx.net>
69
70 * calendar/todos.el (todos-insert-item): Fix last change to make
71 sure calling insertion "here" from outside goal todo items section
72 gives new item top priority. With priority insertion, if user
73 cancels before setting priority, restore display.
74 (todos-find-item): Restore narrowing after searching.
75 (todos-item-done): Allow adding (same) comment to marked items.
76 Don't add empty comment to done item.
77
782013-03-13 Stephen Berman <stephen.berman@gmx.net>
79
80 * calendar/todos.el (todos-quit): If quitting
81 todos-filtered-items-mode makes todos-mode current, don't call
82 todos-show, which (here wrongly) prompts for a new Todos file.
83 (todos-delete-category): Fix incorrect quotation mark.
84 (todos-set-item-priority): Make prefix argument a no-op with
85 commands for raising or lowering item priority. Move mistakenly
86 placed right paren to end of defun, where it belongs.
87
882013-02-25 Stephen Berman <stephen.berman@gmx.net>
89
90 * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'.
91 (todos-show): Prompt for which todo file to visit when invoked
92 from Todos mode.
93
942013-02-19 Stephen Berman <stephen.berman@gmx.net>
95
96 * calendar/todos.el: Item insertion and done/undo fixes.
97 (todos-insert-item): Maybe set the insertion file to
98 todos-global-current-todos-file. When inserting into a file that
99 was not being visited on invoking this command, ensure chosen
100 category is properly selected. Make item inserted "here" the
101 first todo item if the command was invoked with point in done
102 items section or outside of the current category.
103 (todos-item-done): When done items are shown, put cursor on first
104 just done item.
105 (todos-item-undo): Put cursor on undone item.
106
1072013-02-16 Stephen Berman <stephen.berman@gmx.net>
108
109 * calendar/todos.el: Improve handling of overlays.
110 (todos-get-overlay): New function.
111 (todos-prefix-overlay): Remove, since subsumed by
112 todos-get-overlay, and replace by the latter in callers.
113 (todos-reset-prefix): Apply only to buffer visiting Todos files.
114 Simplify implementation and use `todos' overlay property.
115 (todos-reset-done-separator): Use todos-get-overlay and `todos'
116 overlay property. Fix logic.
117 (todos-category-select): Use todos-get-overlay and `todos' overlay
118 property.
119 (todos-remove-item): Use todos-get-overlay. Correct obsolete code.
120 (todos-prefix-overlays): Use todos-top-priority face also for
121 non-numerical prefix of top priority items. Add `todos' overlay
122 property.
123 (todos-hide-show-date-time): Simplify, using todos-get-overlay and
124 `todos' overlay property.
125
1262013-02-14 Stephen Berman <stephen.berman@gmx.net>
127
128 * calendar/todos.el (todos-edit-multiline, todos-edit-quit):
129 Revert buffer renaming.
130
1312013-02-11 Stephen Berman <stephen.berman@gmx.net>
132
133 * calendar/todos.el (todos-edit-quit): On quitting file editing,
134 rename buffer back to current Todos file. After selecting
135 category, put point at top instead of recentering.
136
1372013-02-08 Stephen Berman <stephen.berman@gmx.net>
138
139 * calendar/todos.el (todos-edit-multiline-item): Revert to using
140 indirect buffer, which makes it easier to return to Todos mode.
141 (todos-edit-quit): Don't delete and reinsert items that don't need
142 indenting. Revert to just killing buffer on quitting single item
143 editing. On quitting file editing, select nearest category.
144
1452013-02-07 Stephen Berman <stephen.berman@gmx.net>
146
147 * calendar/todos.el: Bug fixes and improvements to item editing
148 and insertion.
149 (todos-check-format): Compare current value of todos-categories
150 with actual categories sexp.
151 (todos-repair-categories-sexp): Add warning to doc string about
152 category order getting restored to list element order.
153 (todos-mode-external-set): When todos-categories is nil, as in
154 Todos Edit mode, set it by reading actual categories sexp.
155 (todos-edit-mode): Make buffer writeable.
156 (todos-done-item-section-p): New function.
157 (todos-insert-item): Use it as part of preventing insertion here
158 in done items section. Move check for display of done items only
159 to just before setting new item's priority, and if cancelled after
160 toggling to todo items, restore display of done items.
161 (todos-edit-multiline-item): Don't base on todos-edit-multiline
162 but just narrow and change mode.
163 (todos-edit-multiline): Don't make indirect buffer but just widen
164 and change mode; also remove overlays.
165 (todos-edit-quit): Restore Todos mode and category display; when
166 quitting multiline item editing, ensure items above edited item
167 are visible in window if possible.
168 (todos-done-item-add-edit-or-delete-comment): If user moved point
169 during editing, make sure it moves back to edited item before
170 returning.
171
1722013-02-05 Stephen Berman <stephen.berman@gmx.net>
173
174 * calendar/todos.el (todos-reset-done-separator-string):
175 Complete the implementation.
176 (todos-hide-show-done-items): If start of done items sections is
177 below the bottom of the window, make it visible.
178 (todos-insert-item): Allow inserting item here to work outside of
179 the current category, but then at top of category. After checking
180 whether only done items are shown, restore point to ensure
181 inserting item here works correctly.
182 (todos-set-item-priority): Delete leftover right paren at end.
183
1842013-02-04 Stephen Berman <stephen.berman@gmx.net>
185
186 * calendar/todos.el: Bug fixes involving or displaying done items.
187 (todos-done-separator): Make length of long separator one less
188 than window-width, in order to avoid following empty line.
189 (todos-forward-item, todos-backward-item): Make empty line below
190 last todo item accessible only by invoking without a numerical
191 prefix argument and make the latter invocations move only to items.
192 (todos-insert-item): Set todos-current-todos-file after selecting
193 buffer, in order not to set global value. If only done items are
194 shown when this command is invoked, toggle to show todo items to
195 avoid insertion into done items section. When done items are
196 shown, protect from cancelling before setting item priority: this
197 also needs recentering to display all items.
198 (todos-set-item-priority): Only call on (not done) todo items.
199 Check that done items are visible not because file is widened.
200 Use only `any' argument of called-interactively-p. Make sure that
201 giving an undone item lowest priority restores it to the todo
202 section.
203 (todos-item-done): If done items are visible on invoking this
204 command, keep them visible afterwards. Stop looking for marked
205 items on reaching the empty line below the last todo item.
206
2072013-02-02 Stephen Berman <stephen.berman@gmx.net>
208
209 * calendar/todos.el: Several small fixes and improvements.
210 (todos-done-separator-string): Change default value.
211 (todos-update-categories-sexp): Remove unnecessary and misquided
212 setq of todos-default-todos-file. Use delete-region instead of
213 kill-region to avoid polluting kill-ring.
214 (todos-unload-hook): Remove (was not used).
215 (todos-edit-multiline): Don't generate new edit buffer name on
216 each invocation---that can cause confusion due to indirect buffer.
217 (todos-edit-quit): Ensure lines in edit buffer that follow hard
218 newlines are indented in the file to conform to diary format.
219 (todos-set-item-priority): If done items in category are visible,
220 keep them visible.
221
2222013-01-30 Stephen Berman <stephen.berman@gmx.net>
223
224 * calendar/todos.el: Fix done separator overlay bug. Remove most
225 FIXME comments.
226 (todos-reset-and-enable-done-separator): Remove commented out
227 workaround for done separator overlay bug; fix doc string.
228 (todos-reset-done-separator): Delete old overlay after adding new
229 overlay to fix done separator overlay bug; improve implementation.
230 (todos-prefix-overlays): Improve first line of doc string.
231
2322013-01-29 Stephen Berman <stephen.berman@gmx.net>
233
234 * calendar/todos.el: Improve item marking and handling of marked items.
235 (todos-prefix): Add validator to ensure value differs from that of
236 todos-item-mark.
237 (todos-item-mark): New defcustom.
238 (todos-prefix-overlay): New function.
239 (todos-marked-item-p): Use it. Adapt implementation to new
240 handling of marked items.
241 (todos-insert-with-overlays): When inserting pushes down a marked
242 item, move its prefix overlay.
243 (todos-prefix-overlays): Add overlay even when prefix is empty string,
244 otherwise item marking fails. Improve handling of marked items.
245 (todos-mark-unmark-item): Adapt to new handling of marked items
246 and simplify by removing marking of all items in category.
247 (todos-mark-category): Adapt to new handling of marked items and
248 don't use todos-mark-unmark-item.
249 (todos-unmark-category): Adapt to new handling of marked items.
250 (todos-delete-item): Remove obsolete handling of marked items and
251 useless restoration of point.
252 (todos-set-item-priority): Use new handling of marked items.
253 (todos-move-item, todos-item-done, todos-item-undo)
254 (todos-archive-done-item): Remove obsolete handling of marked items.
255
2562013-01-25 Stephen Berman <stephen.berman@gmx.net>
257
258 * calendar/todos.el: Improve definitions and use of some faces.
259 (todos-top-priority): Use current definition of font-lock-constant-face.
260 (todos-diary-expired): Make default value contrast more with
261 default value of todos-date face.
262 (todos-nondiary, todos-category-string): New faces.
263 (todos-nondiary-face, todos-category-string-face): Corresponding
264 new variables.
265 (todos-done, todos-comment): Switch default values to go better
266 with default value of todos-date face.
267 (todos-done-sep): Change default value.
268 (todos-category-string-matcher-1)
269 (todos-category-string-matcher-2): Improve doc string.
270 (todos-font-lock-keywords): Use todos-nondiary-face and
271 todos-category-string-face.
272 (todos-done-separator): Propertize string with todos-done-sep face.
273 (todos-filtered-items-mode): Fix typo.
274
2752013-01-23 Stephen Berman <stephen.berman@gmx.net>
276
277 * calendar/todos.el: Improve handling of saved top priorities items.
278 (todos-find-item): Find done items and items whose priority has
279 changed or whose text was truncated or augmented; add doc string.
280 (todos-check-top-priorities): Highlight each item that is not up
281 to date.
282 (todos-jump-to-item): Jump to items whose priority has changed or
283 whose text was truncated or augmented.
284
2852013-01-22 Stephen Berman <stephen.berman@gmx.net>
286
287 * calendar/todos.el: Revise handling of initial display and extend
288 to top priorities file.
289 (todos-display-categories-first): Remove, replacing by this:
290 (todos-show-first): New defcustom.
291 (todos-first-visit): Remove, replacing by this:
292 (todos-visited): New variable.
293 (todos-absolute-file-name): Extend possible values of optional
294 argument to take top priorities files into account.
295 (todos-modes-set-3, todos-mode): Remove use of todos-first-visit.
296 (todos-mode-external-set): Call find-file-noselect instead of
297 find-buffer-visiting, since the latter may fail.
298 (todos-show): Revise handling of initial display using
299 todos-show-first and todos-visited and extend to top priorities
300 file.
301 (todos-quit): Adapt to new handling of initial display.
302
3032013-01-14 Stephen Berman <stephen.berman@gmx.net>
304
305 * calendar/todos.el: Implement saving top priority items buffers,
306 improve implementation of item filtering commands and
307 infrastucture, and fix two bugs.
308 (todos-prefix-overlays): Use todos-top-priority face only in Todos
309 mode.
310 (todos-multiple-filter-files): Get file-truename of Todos file.
311 (todos-filter-items): Pass a list of files from the caller instead
312 of building it here, and move handling of cancelled file selection
313 dialog to callers. Correct omission of file-wide default number
314 of top priorities.
315 (todos-filtered-buffer-name): Treat file-list argument only as a list.
316 (todos-find-item, todos-check-top-priorities)
317 (todos-top-priorities-filename)
318 (todos-save-top-priorities-buffer): New functions.
319 (todos-save): Use todos-save-top-priorities-buffer.
320 (todos-jump-to-item): Refactor and use todos-find-item.
321 (todos-top-priorities): Simplify semantics of prefix argument.
322 Check if top priorities file exists and if so, visit it, reporting
323 whether it is up to date. Add optional argument and use it to
324 handle multiple files.
325 (todos-diary-items, todos-regexp-items): Add optional argument and
326 use it to handle multiple files.
327 (todos-top-priorities-multifile, todos-diary-items-multifile)
328 (todos-regexp-items-multifile): Refactor, using corresponding
329 non-multifile command.
330 (auto-mode-alist): Add pattern for top priorities files to visit
331 these in Todos Filtered Items mode.
332
3332013-01-08 Stephen Berman <stephen.berman@gmx.net>
334
335 * calendar/todos.el: Fix tabular alignment in Todos Categories mode.
336 (todos-adjusted-category-label-length): New function.
337 (todos-padded-string): Use it.
338
3392013-01-08 Stephen Berman <stephen.berman@gmx.net>
340
341 * calendar/todos.el (todos-move-item): Allow moving done items to
342 done section of another category.
343
3442013-01-06 Stephen Berman <stephen.berman@gmx.net>
345
346 * calendar/todos.el: Display numerical priority string of top
347 priority items in category in a distinctive face.
348 (todos-prefix-string): Make doc string more precise.
349 (todos-top-priority): New defface.
350 (todos-done, todos-done-sep): Use more compact face definition
351 \(taken from font-lock.el).
352 (todos-comment): Give a complete face definition, instead of
353 inheriting from todos-done.
354 (todos-font-lock-keywords): Use todos-comment-face for
355 todos-comment-string-matcher.
356 (todos-prefix-overlays): Use todos-top-priority as the face
357 property of top priority items; don't condition reapplying item
358 prefix overlay on whether the string changed, since that prevents
359 updating display after changing number of top priorities.
360 (todos-set-top-priorities): Call todos-prefix-overlays to update
361 display.
362
3632013-01-04 Stephen Berman <Stephen.Berman@rub.de>
364
365 * calendar/todos.el (todos-reset-global-current-todos-file)
366 (todos-display-categories-1): Use absolute name of
367 todos-default-todos-file.
368
3692013-01-04 Stephen Berman <Stephen.Berman@rub.de>
370
371 * calendar/todos.el (todos-insert-item): Fix copy and paste error
372 from previous change.
373
3742013-01-03 Stephen Berman <stephen.berman@gmx.net>
375
376 * calendar/todos.el: Implement extended category completions.
377 (todos-default-todos-file): Change default value to correct custom
378 type.
379 (todos-category-completions-files): New defcustom.
380 (todos-reevaluate-category-completions-files-defcustom)
381 (todos-absolute-file-name, todos-category-completions): New defuns.
382 (todos-reevaluate-filelist-defcustoms):
383 Add todos-category-completions-files and
384 todos-reevaluate-category-completions-files-defcustom.
385 (todos-allcats-file, todos-all-categories-alist)
386 (todos-jump-to-category-other-file, todos-jump-to-any-category)
387 (todos-move-item-to-file): Remove (todos-all-categories-alist both
388 as defvar and as defun).
389 (todos-read-category): Rewrite using extended category completions
390 and better handling of completion against existing or non-existing
391 categories.
392 (todos-validate-name): Correct doc string; use local instead of
393 dynamic variables in function body.
394 (todos-insert-category-line): Adjust use of todos-jump-to-category
395 to new argument list.
396 (todos-key-bindings, todos-menu): Delete entries for removed
397 commands.
398 (todos-show): Get absolute name of todos-default-todos-file;
399 add `nowarn' argument to find-file-noselect; adjust use of
400 todos-add-category to new argument list.
401 (todos-jump-to-category): Rewrite using extended category
402 completions; reverse argument list, adapting FILE argument to new
403 completion mechanism; add autoload cookie; call todos-show if
404 there are no Todos files.
405 (todos-add-category): Rewrite using extended category completions;
406 add FILE argument to accommodate new completion mechanism.
407 (todos-merge-category): Adapt to extended category completions,
408 adding prefix argument.
409 (todos-insert-item): Adapt to extended category completions; use
410 todos-read-category instead of todos-jump-to-category in prefix
411 argument calls; call todos-show if there are no Todos files; if
412 item is inserted at end of category, recenter to ensure the items
413 above it are displayed in the window.
414 (todos-move-item): Adapt to extended category completions, making
415 argument prefix argument; allow moving within category (for the
416 sake of code simplification); add `nowarn' argument to
417 find-file-noselect.
418 (todos-archive-done-item): Prevent error when attempting to
419 archive not-done todo item; adjust use of todos-add-category to
420 new argument list.
421
4222012-12-15 Stephen Berman <stephen.berman@gmx.net>
423
424 * calendar/todos.el (todos-archive-done-item): Fix archiving of
425 all done items in a category and resulting display of todo file.
426
4272012-12-14 Stephen Berman <stephen.berman@gmx.net>
428
429 * calendar/todos.el (todos-priorities-rules): Fix customization
430 type to prevent mismatch error.
431 (todos-set-top-priorities): Fix rule construction; fix input check;
432 improve prompt.
433
4342012-12-14 Stephen Berman <stephen.berman@gmx.net>
435
436 * calendar/todos.el (todos-insert-item): If user exits Calendar
437 before choosing a date, cancel item insertion.
438 (todos-set-date-from-calendar): If user exits Calendar before
439 choosing a date, clean up properly.
440
4412012-12-12 Stephen Berman <stephen.berman@gmx.net>
442
443 * calendar/todos.el: Extend and improve handling of item editing,
444 especially of date/time header.
445 (todos-month-name-array, todos-month-abbrev-array): New defconsts.
446 (todos-date-pattern): Use explicitly numbered groups.
447 (todos-read-date): Optionally read and return just one of the date
448 string components year, month or monthname, day.
449 (todos-key-bindings): Add bindings for new item header editing
450 commands.
451 (todos-edit-item): Exclude date/time header from minibuffer by
452 default; include it by passing a prefix argument.
453 (todos-edit-item-header-1): New function containing the guts of
454 the commands for editing item date/time headers.
455 (todos-edit-item-header): Use it. Condition editing of time
456 string on value of `todos-always-add-time-string'.
457 (todos-edit-item-date-from-calendar): Use todos-edit-item-header-1.
458 (todos-edit-item-date-to-today): Rename from
459 todos-edit-item-date-is-today and use todos-edit-item-header-1.
460 (todos-edit-item-date): Remove.
461 (todos-edit-item-date-day-name, todos-edit-item-date-year)
462 (todos-edit-item-date-month, todos-edit-item-date-day): New commands.
463
4642012-12-02 Stephen Berman <stephen.berman@gmx.net>
465
466 * calendar/todos.el (todos-show): Fix a comment.
467 (todos-add-category): Prompt for a new category if passed category
468 is the empty string, not nil.
469
4702012-11-26 Stephen Berman <stephen.berman@gmx.net>
471
472 * calendar/todos.el (todos-make-categories-list)
473 (todos-convert-legacy-files, todos-jump-to-item)
474 (todos-move-category, todos-merge-category)
475 (todos-archive-done-item, todos-unarchive-items): Include end of
476 line in regex searches for beginning of category, in order not to
477 get a category whose name contains the searched for category name.
478
4792012-11-15 Stephen Berman <stephen.berman@gmx.net>
480
481 * calendar/todos.el (todos-forward-category): Fix typo.
482
4832012-10-30 Stephen Berman <stephen.berman@gmx.net>
484
485 * calendar/todos.el (todos-define-insertion-command):
486 Let generated insertion commands accept a prefix argument.
487
4882012-10-08 Stephen Berman <Stephen.Berman@rub.de>
489
490 * calendar/todos.el (todos-move-item): If user quits before
491 completing movement, restore display of initial category; if item
492 is moved to end of target category, make sure the items above it
493 are displayed in the window.
494
4952012-10-08 Stephen Berman <stephen.berman@gmx.net>
496
497 * calendar/todos.el: Fixes to todos-move-item and some of its
498 subroutines.
499 (todos-move-item): When there are marked items, point need not be
500 on an item; remove obsolete use of todos-add-category, since this
501 is now already done in todos-read-category; fix typo.
502 (todos-diary-item-p): Exclude empty lines.
503 (todos-read-category): Restore point and narrowing after adding
504 new category, to avoid moving to beginning of file when moving
505 marked items to a new category.
506 (todos-set-item-priority): Prompt for priority only when the
507 category has at least one todo item; only use non-nil priority to
508 calculate insertion location.
509 (todos-read-category): Don't reset todos-categories when a new
510 category is added due to todos-move-item or todos-jump-to-item.
511
5122012-09-24 Stephen Berman <stephen.berman@gmx.net>
513
514 Changes from 2012-07-14 (revision 110020).
515 * calendar/todos.el (todos-copy-item): New command.
516 (todos-insertion-map): Add key binding for it.
517
5182012-09-24 Stephen Berman <stephen.berman@gmx.net>
519
520 Changes from 2012-07-13 (revision 110019).
521 * calendar/todos.el (todos-undo-item-omit-comment): New defcustom.
522 (todos-item-undo): Use it.
523 (todos-allcats-file, todos-all-categories-alist): New variables.
524 (todos-all-categories-alist): New function.
525 (todos-jump-to-any-category): New command.
526 (todos-move-item): Remove mark overlays from buffer items were
527 moved from; update todos-categories-with-marks,
528
5292012-09-24 Stephen Berman <stephen.berman@gmx.net>
530
531 Changes from 2012-06-27 (revision 110018).
532 * calendar/todos.el: Further code rearrangement; further new and
533 revised comments.
534 (todos-reevaluate-filelist-defcustoms): Rename from
535 todos-reevaluate-defcustoms and adjust callers.
536 (todos-date-pattern, todos-nondiary-start, todos-nondiary-end)
537 (todos-date-string-start, todos-done-string-start)
538 (todos-item-start): Change from defvar to defconst.
539 (todos-set-top-priorities): Use read-number and simplify.
540 (todos-insert-item): Check whether date-type argument is a string.
541 (todos-set-date-from-calendar): Check whether
542 todos-date-from-calendar is a string; simplify cond clause.
543 (todos-archive-done-item, todos-unarchive-items):
544 Use buffer-substring-no-properties.
545
5462012-09-23 Stephen Berman <stephen.berman@gmx.net>
547
548 Changes from 2012-06-25 (revision 110017).
549 * calendar/todos.el (todos-item-undo): Fix restoration on
550 cancelling; use buffer-substring-no-properties; comment out code
551 removing mark overlay; fix insertion of undone items; display any
552 remaining done items.
553
5542012-09-23 Stephen Berman <stephen.berman@gmx.net>
555
556 Changes from 2012-06-24 (revision 110016).
557 * calendar/todos.el: Further significant code rearrangement;
558 further comment revision.
559 (todos-mode-display): New defgroup.
560 (todos-prefix, todos-number-priorities)
561 (todos-done-separator-string, todos-done-string)
562 (todos-comment-string, todos-show-with-done)
563 (todos-mode-line-function, todos-skip-archived-categories)
564 (todos-highlight-item, todos-wrap-lines)
565 (todos-line-wrapping-function): Use it.
566 (todos-item-insertion): New defgroup.
567 (todos-include-in-diary, todos-diary-nonmarking)
568 (todos-nondiary-marker, todos-always-add-time-string)
569 (todos-use-only-highlighted-region): Use it.
570 (todos-forward-button, todos-backward-button): New commands.
571 (todos-categories-mode-map): Use them, replacing forward-button
572 and backward-button.
573 (todos-merge-category): Fix and improve implementation; handle
574 archived items.
575 (todos-insert-item, todos-set-date-from-calendar): Handle setting
576 date by calling todos-insert-item-from-calendar.
577 (todos-delete-item): Fix overlay handling.
578 (todos-move-item): Highlight item to be moved.
579 (todos-item-undo): Handle marked items.
580 (todos-insert-item-from-calendar): Rewrite using
581 todos-date-from-calendar.
582
5832012-09-23 Stephen Berman <stephen.berman@gmx.net>
584
585 Changes from 2012-06-21 (revision 110015).
586 * calendar/todos.el: Further comment revision.
587 (todos-sorted-column): Change default value, also taking tty into
588 account.
589 (todos-reset-done-separator): Fix faulty variable binding.
590 (todos-reset-and-enable-done-separator): Save match data; comment
591 out code that causes problems for Edebug.
592 (todos-item-start): Handle empty line between todo and done items
593 when done items are hidden.
594 (todos-read-date): Use a leap year for `*' to allow
595 calendar-last-day-of-month to return Feb. 29.
596 (todos-archive-mode, todos-edit-mode, todos-categories-mode)
597 (todos-filtered-items-mode): Delete faulty parentheses.
598 (todos-quit): Save Todos and archive files unconditionally.
599 (todos-forward-item): Accept only positive prefix argument.
600 (todos-backward-item): Accept only positive prefix argument; don't
601 move point to beginning of buffer if it is on the first item.
602 (todos-hide-show-date-time): Remove obsolete interactive spec.
603 (todos-move-category): Improve prompt string; ensure file moved to
604 is different from file moved from.
605 (todos-merge-categories): Remove.
606 (todos-set-category-priority): New command.
607 (todos-raise-category-priority, todos-lower-category-priority):
608 Use it to define these commands.
609 (todos-set-item-priority): Rewrite and generalize.
610 (todos-raise-item-priority, todos-lower-item-priority): Use it to
611 define these commands.
612
6132012-09-23 Stephen Berman <stephen.berman@gmx.net>
614
615 Changes from 2012-06-15 (revision 110014).
616 * calendar/todos.el (todos-reset-done-separator)
617 (todos-reset-and-enable-done-separator): New functions.
618 (todos-reset-done-separator-string): Rewrite using
619 todos-reset-done-separator for string longer than 1 character.
620 (todos-mode): Add todos-reset-and-enable-done-separator to
621 window-configuration-change-hook, replacing previous anonymous
622 function.
623 (todos-unload-hook): And remove it.
624
6252012-09-23 Stephen Berman <stephen.berman@gmx.net>
626
627 Changes from 2012-06-14 (revision 110013).
628 * calendar/todos.el (todos-done-separator-string): New defcustom.
629 (todos-done-separator): New variable replacing defcustom of the
630 same name.
631 (todos-reset-done-separator-string, todos-done-separator):
632 New functions.
633 (todos-mode): Make function added to
634 window-configuration-change-hook do a better job of updating the
635 done items separator string overlay.
636 (todos-unload-hook): Remove it here.
637 (todos-item-undo): Fix search for item's end.
638
6392012-09-23 Stephen Berman <stephen.berman@gmx.net>
640
641 Changes from 2012-06-03 (revision 110012).
642 * calendar/todos.el: Further comment revision.
643 (todos-sorted-column): Change default value.
644 (todos-item-start): Handle empty category (needed in
645 todos-filter-items).
646 (todos-read-date): Don't use calendar-read; make code cleaner.
647 (todos-multiple-filter-files): Rename this variable from
648 todos-multiple-files and adjust users.
649 (todos-multiple-filter-files-widget): Rename from
650 todos-multiple-files-widget and adjust users.
651 (todos-multiple-filter-files): Rename this function from
652 todos-multiple-files and adjust callers.
653 (todos-filter-items): Remove unused code.
654 (todos-insert-category-line): Add space so highlighting of last
655 column is consistent with the others; adjust display of column
656 highlighting.
657 (todos-menu): Remove obsolete entry.
658 (todos-categories-mode-map): Add new bindings.
659 (todos-display-categories-alphabetically-or-by-priority): New command.
660 (todos-display-categories-sorted-by-todo)
661 (todos-display-categories-sorted-by-diary)
662 (todos-display-categories-sorted-by-done)
663 (todos-display-categories-sorted-by-archived): Restore and fix
664 implementation.
665
6662012-09-23 Stephen Berman <stephen.berman@gmx.net>
667
668 Changes from 2012-06-02 (revision 110011).
669 * calendar/todos.el: Significant code rearrangement; further
670 comment revision.
671 (todos-filtered-items-buffer): Rename from todos-filter-buffer and
672 adjust users.
673 (todos-filtered-buffer-name): Rename from
674 todos-special-buffer-name and adjust users.
675 (todos-filtered-items-mode-map): Rename from
676 todos-filter-items-mode-map and adjust users.
677 (todos-mode-external-set): Use todos-categories instead of
678 todos-set-categories (and add comment to check if this DTRT).
679 (todos-filtered-items-mode): Rename from todos-filter-items-mode
680 and adjust users.
681 (todos-add-category): Don't call todos-validate-name, since
682 todos-read-category does.
683 (todos-edit-quit): Use todos-repair-categories-sexp.
684 (todos-done-item-add-edit-or-delete-comment): Rename from
685 todos-done-item-add-or-edit-comment and adjust users; add optional
686 argument to prompt to delete comment.
687 (todos-item-undo): Delete done item comment on undoing if user
688 confirms.
689
6902012-09-22 Stephen Berman <stephen.berman@gmx.net>
691
692 Changes from 2012-06-02 (revision 110010).
693 * calendar/todos.el: Further code rearrangement and comment
694 revision.
695 (todos-item-start): Handle empty line between todo and done items
696 when done items are displayed.
697 (todos-key-bindings): Comment out bindings meant only for
698 todos-archive-mode.
699 (todos-archive-mode-map): Fix typo.
700 (todos-archive-mode): Derive from special-mode instead of
701 todos-mode to prevent its key bindings from being available here.
702 (todos-archive-done-item): Remove obsolete code; fix item count
703 updating.
704 (todos-unarchive-items): Simplify; fix unarchiving of all items in
705 category; fix item count updating; fix typo.
706
7072012-09-22 Stephen Berman <stephen.berman@gmx.net>
708
709 Changes from 2012-06-01 (revision 110009).
710 * calendar/todos.el: Further code rearrangement and comment
711 revision.
712 (todos-add-to-buffer-list, todos-update-buffer-list): New functions.
713 (todos-file-buffers): New variable.
714 (todos-reset-global-current-todos-file): Use it to simplify
715 implementation of this function.
716 (todos-filtered): New defgroup.
717 (todos-filter-buffer, todos-top-priorities-buffer)
718 (todos-diary-items-buffer, todos-regexp-items-buffer)
719 (todos-priorities-rules, todos-show-priorities)
720 (todos-filter-files, todos-filter-done-items): Use it.
721 (todos-skip-archived-categories): Rename from
722 todos-ignore-archived-categories and adjust users.
723 (todos-display-as-todos-file): Rename from todos-after-find-file
724 and adjust callers.
725 (todos-reset-highlight-item, todos-mode-external-set)
726 (todos-jump-to-category, todos-jump-to-item)
727 (todos-raise-category-priority, todos-insert-item)
728 (todos-move-item): Use find-file-visiting.
729 (todos-make-categories-list): Use file-truename.
730 (todos-display-categories-1): Adjust title text for archive files;
731 use done label for item counts in archive files.
732 (todos-modes-set-3): Add todos-display-as-todos-file to
733 find-file-hook.
734 (todos-mode): Add todos-add-to-buffer-list to find-file-hook and
735 todos-update-buffer-list post-command-hook.
736 (todos-unload-hook): And remove them.
737 (todos-show): Only when interactively invoked from an archive,
738 switch to corresponding Todos file.
739 (todos-archive-done-item): Remove obsolete code; fix handling of
740 marked items; fix search for existing category; check whether
741 archive exists and write to file if not; improve display handling.
742
7432012-09-21 Stephen Berman <stephen.berman@gmx.net>
744
745 Changes from 2012-05-29 (revision 110008).
746 * calendar/todos.el: Further comment revision.
747 (todos-item-end): Replace use of command todos-forward-item by
748 regexp searches using internal variables.
749 (todos-raise-category-priority): Improve and comment.
750 (todos-insert-item): Fix insertion of empty time string.
751
7522012-09-21 Stephen Berman <stephen.berman@gmx.net>
753
754 Changes from 2012-05-29 (revision 110007).
755 * calendar/todos.el (todos-ignore-archived-categories):
756 Revert last change; remove :initialize and :set functions; change
757 use and change users accordingly.
758 (todos-reset-categories, todos-categories-full)
759 (todos-truncate-categories-list): Remove.
760 (todos-set-categories, todos-update-categories-sexp):
761 Use todos-categories instead of todos-categories-full; remove use
762 of todos-ignore-archived-categories and
763 todos-truncate-categories-list.
764 (todos-check-format, todos-repair-categories-sexp):
765 Use todos-categories instead of todos-categories-full.
766 (todos-read-category): Improve last change.
767 (todos-validate-name): Use completing-read.
768 (todos-categories-category-number): Rename from
769 todos-category-number and adjust users.
770 (todos-update-categories-display, todos-mode-external-set)
771 (todos-delete-category, todos-move-category, todos-merge-category)
772 (todos-unarchive-items): Remove use of todos-categories-full and
773 todos-ignore-archived-categories.
774 (todos-modes-set-3, todos-add-category): Remove use of
775 todos-categories-full.
776 (todos-edit-mode): Fix typo.
777 (todos-forward-category): Use todos-ignore-archived-categories.
778
7792012-09-21 Stephen Berman <stephen.berman@gmx.net>
780
781 Changes from 2012-05-28 (revision 110006).
782 * calendar/todos.el: Doubts about todos-ignore-archived-categories.
783 (todos-ignore-archived-categories): Change default value.
784
7852012-09-21 Stephen Berman <stephen.berman@gmx.net>
786
787 Changes from 2012-05-27 (revision 110005).
788 * calendar/todos.el: Further comment revision.
789 (todos-reset-global-current-todos-file):
790 Try to make this not slow down kill-buffer.
791 (todos-update-categories-sexp): Handle the case where there is no
792 categories sexp yet, i.e. after inserting the first item in the
793 file, so todos-display-categories works.
794 (todos-read-file-name): Improve implementation.
795 (todos-validate-name): Use variable todos-files.
796 (todos-category-number): New variable.
797 (todos-insert-category-line, todos-update-categories-display)
798 (todos-raise-category-priority): Use it.
799 (todos-add-file): Remove unused remnant code.
800
8012012-09-21 Stephen Berman <stephen.berman@gmx.net>
802
803 Changes from 2012-05-25 (revision 110004).
804 * calendar/todos.el: Further comment revision.
805 (todos-set-item-top-priority): New command.
806 (todos-reset-global-current-todos-file):
807 Use todos-files-function instead of todos-files.
808 (todos-read-category): Add optional argument to test whether
809 caller adds new category; if so, don't prompt for new category and
810 don't restore original todos-categories list.
811 (todos-categories-mode-map): Update to renamed commands.
812 (todos-filter-items-mode-map): Add binding for new command.
813 (todos-mode): Fix typo.
814 (todos-show): If called from archive file, show corresponding
815 category in Todos file, if it exists.
816 (todos-jump-to-category): Remove code to add new category, since
817 todos-read-category can do that.
818 (todos-add-file): Remove obsolete code; visit new file in selected
819 window.
820 (todos-add-category): Simplify.
821 (todos-rename-category): Use force-mode-line-update instead of
822 setting mode-line-buffer-identification.
823 (todos-delete-category): Improve logic of prompts; use
824 todos-categories-full and check todos-ignore-archived-categories.
825 (todos-raise-category-priority, todos-lower-category-priority):
826 Rename from todos-{raise,lower}-category and adjust callers.
827 (todos-move-category, todos-merge-category):
828 Set todos-categories-full; on setting todos-categories check
829 todos-ignore-archived-categories.
830 (todos-insert-item): Let-bind use-empty-active-region and use
831 use-region-p instead of transient-mark-mode.
832 (todos-raise-item-priority): Improve implementation.
833 (todos-archive-done-item): Rename from
834 todos-archive-done-item-or-items and adjust callers; confine to
835 Todos mode.
836 (todos-unarchive-items): On setting todos-categories check
837 todos-ignore-archived-categories.
838
8392012-09-21 Stephen Berman <stephen.berman@gmx.net>
840
841 Changes from 2012-05-23 (revision 110003).
842 * calendar/todos.el (todos-key-bindings): Remove binding of
843 deleted command.
844 (todos-menu): Remove entry of deleted command.
845 (todos-show-archive): Fix last change.
846 (todos-done-item-add-or-edit-comment): Rename from
847 todos-comment-done-item and adjust callers; prompt to edit an
848 existing comment.
849
8502012-09-21 Stephen Berman <stephen.berman@gmx.net>
851
852 Changes from 2012-05-22 (revision 110002).
853 * calendar/todos.el (todos-set-show-current-file): Rename from
854 todos-toggle-show-current-file and adjust callers.
855 (todos-number-priorities): Rename from todos-number-prefix and
856 adjust users.
857 (todos-update-count): Rename from todos-set-count and adjust
858 callers.
859 (todos-hide-show-item-numbering): Rename from
860 todos-toggle-item-numbering and adjust callers.
861 (todos-hide-show-done-items): Rename from
862 todos-toggle-view-done-items and adjust callers.
863 (todos-show-done-only): Rename from todos-toggle-show-done-only.
864 (todos-view-archived-items): Comment out.
865 (todos-show-archive): Prompt to choose another archive file if
866 current Todos file lacks an archive; prompt to visit archive
867 anyway when current category has no archived items.
868
8692012-09-21 Stephen Berman <stephen.berman@gmx.net>
870
871 Changes from 2012-05-21 (revision 110001).
872 * calendar/todos.el: Further comment revision and code
873 rearrangement.
874 (todos-item-end): Revert last change.
875 (todos-key-bindings, todos-menu, todos-archive-mode-map)
876 (todos-filter-items-mode-map): Use renamed commands.
877 (todos-hide-show-date-time): Rename from
878 todos-toggle-display-date-time.
879 (todos-mark-unmark-item): Rename from todos-toggle-mark-item and
880 adjust caller.
881 (todos-backward-item): Exempt special handling only from
882 todos-regexp-items-buffer instead of todos-filter-items-mode.
883 (todos-raise-item-priority): Don't allow item reprioritizing in
884 Todos filter items mode except for top priority items.
885
8862012-09-21 Stephen Berman <stephen.berman@gmx.net>
887
888 Changes from 2012-05-19 (revision 110000).
889 * calendar/todos.el: Add and revise further doc strings and
890 comments.
891 (todos-filter-function, todos-custom-items)
892 (todos-custom-items-multifile): Remove.
893 (todos-filter-done-items): New defcustom.
894 (todos-item-end, todos-backward-item): Handle todos-filter-items-mode.
895 (todos-filter-items): Check return value of caller first; tag
896 archived items for todos-jump-to-item; delete categories sexp
897 before processing filter; check todos-filter-done-items for
898 whether to leave done items; remove custom filter; fix regexp for
899 file and category tags; don't invoke buffer fontification.
900 (powerset-recursive): Fix typo.
901 (todos-key-bindings): Remove unused bindings.
902 (todos-top-priorities-multifile, todos-diary-items-multifile)
903 (todos-regexp-items-multifile): Use variable todos-multiple-files.
904 (todos-jump-to-item): Fix regexp; handle archive tags; take
905 todos-filter-done-items into account.
906 (todos-insert-item-from-calendar): Relocate to end of file
907 together with key-binding as addition to calendar.el.
908
9092012-09-20 Stephen Berman <stephen.berman@gmx.net>
910
911 Changes from 2012-05-17 (revision 109999).
912 * calendar/todos.el: Add and revise further doc strings and
913 comments; major code rearrangement.
914 (todos-merged-files, todos-prompt-merged-files)
915 (todos-print-priorities, todos-tmp-buffer-name)
916 (todos-top-priorities-widgets, todos-update-merged-files)
917 (todos-merged-top-priorities, todos-merged-diary-items)
918 (todos-merged-regexp-items, todos-merged-custom-items)
919 (todos-raw-mode, todos-change-default-file)
920 (todos-toggle-diary-inclusion, todos-toggle-item-diary-nonmarking)
921 (todos-toggle-diary-nonmarking, todos-validate-category-name):
922 Remove.
923 (todos-category-string-matcher): Comment out.
924 (todos-categories): New defgroup.
925 (todos-initial-file, todos-filter-buffer)
926 (todos-top-priorities-buffer, todos-categories-category-label)
927 (todos-diary-items-buffer, todos-regexp-items-buffer)
928 (todos-custom-items-buffer, todos-filter-files)
929 (todos-highlight-item, todos-todo-mode-date-time-regexp):
930 New defcustoms.
931 (todos-diary-expired): New face.
932 (todos-print-buffer, todos-multiple-files)
933 (todos-multiple-files-widget, todos-key-bindings): New variables.
934 (todos-short-file-name, todos-reevaluate-default-file-defcustom)
935 (todos-special-buffer-name)
936 (todos-reevaluate-filter-files-defcustom)
937 (todos-reset-highlight-item, todos-reevaluate-defcustoms)
938 (todos-nondiary-marker-matcher, todos-diary-nonmarking-matcher)
939 (todos-diary-expired-matcher, todos-category-string-matcher-1)
940 (todos-category-string-matcher-2, todos-repair-categories-sexp)
941 (todos-validate-name, todos-multiple-files)
942 (todos-display-categories-1, todos-update-categories-display)
943 (todos-modes-set-3, todos-mode-external-set): New functions.
944 (todos-set-top-priorities-in-file)
945 (todos-set-top-priorities-in-category)
946 (todos-top-priorities-multifile, todos-diary-items-multifile)
947 (todos-regexp-items-multifile, todos-custom-items-multifile)
948 (todos-convert-legacy-files, todos-jump-to-item)
949 (todos-edit-multiline-item, todos-edit-item-date-from-calendar)
950 (todos-edit-item-diary-inclusion)
951 (todos-edit-category-diary-inclusion)
952 (todos-edit-item-diary-nonmarking)
953 (todos-edit-category-diary-nonmarking): New commands.
954 (todos, todos-faces): Update :version.
955 (todos-done-separator, todos-completion-ignore-case):
956 Change default value.
957 (todos-done-separator): Change :set function.
958 (todos-indent-to-here): Add :validate function to :type.
959 (todos-prefix-string, todos-mark, todos-button)
960 (todos-sorted-column, todos-archived-only, todos-search)
961 (todos-done, todos-done-sep): Provide full face definitions
962 instead of inheriting.
963 (todos-edit-buffer, todos-categories-buffer): Change from
964 defcustom to defvar.
965 (todos-category-beg, todos-category-done): Change from defvar to
966 defconst.
967 (todos-files): Check if todos-files-directory exists.
968 (todos-default-todos-file, todos-mode-line-control, todos-print):
969 Use todos-short-file-name.
970 (todos-font-lock-keywords): Use todos-nondiary-marker-matcher,
971 todos-diary-nonmarking-matcher, todos-category-string-matcher-1,
972 todos-category-string-matcher-2, todos-diary-expired-matcher.
973 (todos-category-select): Use todos-done-string-start, and
974 condition search on todos-show-with-done; don't make display
975 overlay for done items separator string if there already is one;
976 use todos-highlight-item, require hl-line and activate
977 hl-line-mode here in order to avoid a hang if done in todos-mode
978 or the mode hook.
979 (todos-update-categories-sexp): Use todos-categories-full if set,
980 otherwise todos-categories.
981 (todos-make-categories-list): Don't test for archive file when
982 processing a legacy todo-mode file.
983 (todos-check-format): Add check for todos-categories sexp.
984 (todos-diary-item-p): Use todos-nondiary-start instead of
985 todos-date-pattern.
986 (todos-marked-item-p): Rename from todos-item-marked-p.
987 (todos-read-file-name): Don't accept empty name; validate.
988 (todos-read-category): Validate new name before prompting whether
989 to add new category; force quit if user answers no.
990 (todos-filter-items): Improve implementation.
991 (todos-set-top-priorities): Rewrite as a noninteractive function
992 using minibuffer input instead of widgets.
993 (todos-insert-sort-button): Call todos-display-sorted with
994 argument nil to display categories in numerical order, instead of
995 calling todos-display-categories.
996 (powerset-recursive): Borrow and slightly reformulate the (GDFL'd)
997 Common Lisp powerset function at
998 http://rosettacode.org/wiki/Power_set#Common_Lisp.
999 (powerset-bitwise): Implement in Emacs Lisp the (GDFL'd) C
1000 powerset function at http://rosettacode.org/wiki/Power_set#C.
1001 (todos-powerset): Defalias to powerset-bitwise.
1002 (todos-mode-map): Generate from todos-key-bindings instead of
1003 listing each key definition.
1004 (todos-categories-mode-map): Add two bindings.
1005 (todos-filter-items-mode-map): Add some bindings, remove others.
1006 (todos-mode): Derive from special-mode; use todos-modes-set-3; add
1007 function setting todos-done-separator to
1008 window-configuration-change-hook.
1009 (todos-unload-hook): Remove function setting todos-done-separator
1010 from window-configuration-change-hook.
1011 (todos-archive-mode): Derive from todos-mode; use todos-modes-set-3.
1012 (todos-edit-mode): Derive from text-mode; use todos-mode-external-set.
1013 (todos-categories-mode): Derive from special-mode; use
1014 todos-mode-external-set.
1015 (todos-filter-items-mode): Derive from special-mode.
1016 (todos-quit): Save archive file if it hasn't yet been saved.
1017 (todos-display-categories): Delegate all functionality to
1018 todos-display-categories-1 and todos-update-categories-display.
1019 (todos-toggle-view-done-items): Improve implementation.
1020 (todos-highlight-item): Require hl-line.
1021 (todos-toggle-display-date-time): Remove argument and make it
1022 apply only to whole file.
1023 (todos-top-priorities, todos-diary-items, todos-regexp-items)
1024 (todos-custom-items): Use todos-special-buffer-name.
1025 (todos-add-file): Use todos-short-file-name and
1026 todos-reevaluate-defcustoms; remove validation, since it's now
1027 done in todos-read-file-name.
1028 (todos-add-category): Also update todos-categories-full if non-nil.
1029 (todos-delete-category): Delete file after confirmation if only
1030 category is deleted.
1031 (todos-move-category): Use todos-short-file-name and
1032 todos-reevaluate-defcustoms.
1033 (todos-insert-item): Fix getting date from the calendar and
1034 insertion of time string.
1035 (todos-set-date-from-calendar): Enter calendar buffer, suppressing
1036 display of diary entries.
1037 (todos-edit-multiline): Add optional argument to restrict editing
1038 buffer to current item, otherwise make entire buffer (i.e. whole
1039 file) editable.
1040 (todos-edit-quit): When whole file is editable, check file format
1041 validity before killing buffer, and if valid, recalculate
1042 categories sexp to be safe.
1043 (todos-edit-item-header): Allow choosing date from calendar.
1044 (todos-item-done): Handle marked items.
1045
10462012-09-19 Stephen Berman <stephen.berman@gmx.net>
1047
1048 Changes from 2011-12-03 (revision 109998).
1049 * calendar/todos.el (todos-item-start): Restore commented out code
1050 to prevent wrongly moving point in widened buffer.
1051
10522012-09-19 Stephen Berman <stephen.berman@gmx.net>
1053
1054 Changes from 2011-12-02 (revision 109997).
1055 * calendar/todos.el: Remove old commentary from todo-mode.el; add
1056 and revise further doc strings and comments; require cl.el at
1057 compile time for remove-duplicates; use function powerset from
1058 http://rosettacode.org/wiki/Power_set#Common_Lisp (GFDL); further
1059 code rearrangement. Add adapted version of diary-goto-entry as comment.
1060 (todos-file-top, todos-archived-categories-buffer)
1061 (todos-save-top-priorities-too, todos-toggle-item-diary-inclusion)
1062 (todos-save-top-priorities, todos-reset-separator)
1063 (todos-switch-todos-file, todos-item-string-start, todos-counts)
1064 (todos-string-count-lines, todos-string-multiline-p)
1065 (todos-display-categories-alphabetically): Remove.
1066 (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1067 (todos-insert-item-ask-date-time-for-diary)
1068 (todos-insert-item-ask-date-time-for-diary-here)
1069 (todos-insert-item-ask-date-time-here)
1070 (todos-insert-item-ask-date-maybe-notime)
1071 (todos-insert-item-ask-date-maybe-notime-for-diary)
1072 (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1073 (todos-insert-item-ask-date-maybe-notime-here)
1074 (todos-insert-item-ask-date-for-diary)
1075 (todos-insert-item-ask-date-for-diary-here)
1076 (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1077 (todos-insert-item-ask-dayname-time)
1078 (todos-insert-item-ask-dayname-time-for-diary)
1079 (todos-insert-item-ask-dayname-time-for-diary-here)
1080 (todos-insert-item-ask-dayname-time-here)
1081 (todos-insert-item-ask-dayname-maybe-notime)
1082 (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1083 (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1084 (todos-insert-item-ask-dayname-maybe-notime-here)
1085 (todos-insert-item-ask-dayname-for-diary)
1086 (todos-insert-item-ask-dayname-for-diary-here)
1087 (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1088 (todos-insert-item-ask-time-for-diary)
1089 (todos-insert-item-ask-time-for-diary-here)
1090 (todos-insert-item-ask-time-here)
1091 (todos-insert-item-maybe-notime)
1092 (todos-insert-item-maybe-notime-for-diary)
1093 (todos-insert-item-maybe-notime-for-diary-here)
1094 (todos-insert-item-maybe-notime-here)
1095 (todos-insert-item-for-diary, todos-insert-item-for-diary-here)
1096 (todos-insert-item-here): Remove; all of these are now generated
1097 on loading (some with the same name, most with other names.)
1098 (todos-item-counts, todos-display-categories-alphabetically)
1099 (todos-display-categories-sorted-by-todo)
1100 (todos-display-categories-sorted-by-diary)
1101 (todos-display-categories-sorted-by-done)
1102 (todos-display-categories-sorted-by-archived): Comment out.
1103 (todos-comment-string, todos-mode-line-function)
1104 (todos-filter-function, todos-priorities-rules)
1105 (todos-visit-files-commands, todos-categories-totals-label)
1106 (todos-use-only-highlighted-region, todos-diary-nonmarking):
1107 New defcustoms.
1108 (todos-mark, todos-comment): New faces.
1109 (todos-comment-face): Corresponding new variable.
1110 (todos-categories-full, todos-global-current-todos-file)
1111 (todos-first-visit, todos-insertion-commands-args-genlist)
1112 (todos-insertion-commands-args, todos-insertion-commands-names)
1113 (todos-insertion-commands, todos-insertion-commands-arg-key-list)
1114 (todos-top-priorities-widgets, todos-date-from-calendar)
1115 (todos-item-mark, todos-categories-with-marks): New variables.
1116 (todos-mode-line-control, todos-reset-global-current-todos-file)
1117 (todos-gen-arglists, todos-insertion-command-name)
1118 (todos-insertion-key-bindings, todos-unload-hook)
1119 (todos-filter-items, todos-set-date-from-calendar)
1120 (todos-comment-string-matcher, todos-after-find-file)
1121 (todos-reset-nondiary-marker, todos-reset-done-string)
1122 (todos-reset-comment-string, todos-show-current-file)
1123 (todos-item-marked-p, todos-total-item-counts): New functions.
1124 (todos-define-insertion-command): New macro.
1125 (todos-toggle-mark-item, todos-mark-category)
1126 (todos-unmark-category, todos-set-top-priorities)
1127 (todos-merged-diary-items, todos-regexp-items)
1128 (todos-merged-regexp-items, todos-custom-items)
1129 (todos-merged-custom-items, todos-comment-done-item)
1130 (todos-archive-category-done-items, todos-unarchive-items)
1131 (todos-print-to-file): New commands.
1132 (todos-done-separator): Change :set function.
1133 (todos-done-string): Uncomment :initialize and :set functions.
1134 (todos-files): Use file-truename.
1135 (todos-show-current-file): Rename from
1136 todos-auto-switch-todos-file and change :set function accordingly.
1137 (todos-font-lock-keywords): Use todos-comment-string-matcher;
1138 change names of other matcher functions to new *-matcher.
1139 (todos-category-number): Change initial value.
1140 (todos-insertion-map): Use todos-insertion-key-bindings to
1141 generate key definitions.
1142 (todos-mode-map): Don't suppress digit keys, so they can supply
1143 prefix arguments; add new and change some existing bindings.
1144 (todos-archive-mode-map): Change a key binding.
1145 (todos-categories-mode-map): Comment out a key binding.
1146 (todos-filter-items-mode-map): Rename from
1147 todos-top-priorities-mode-map.
1148 (todos-mode): Make todos-current-todos-file,
1149 todos-categories-full, todos-categories, todos-first-visit,
1150 todos-category-number, todos-show-done-only,
1151 todos-categories-with-marks local variables and set them; add
1152 todos-show-current-file to pre-command-hook, todos-after-find-file
1153 to post-command-hook and todos-reset-global-current-todos-file to
1154 kill-buffer-hook.
1155 (todos-archive-mode): Make todos-current-todos-file,
1156 todos-categories and todos-category-number local variables and set
1157 them; add todos-after-find-file to post-command-hook.
1158 (todos-raw-mode): New derived major mode.
1159 (todos-categories-mode): Don't set font-lock-defaults and
1160 buffer-read-only; make todos-current-todos-file and
1161 todos-categories local variables and set them.
1162 (todos-filter-items-mode): Rename from todos-top-priorities-mode-map.
1163 (todos-quit): Don't reset todos-categories on quitting
1164 todos-categories-mode; handle quitting todos-filter-items-mode.
1165 (todos-show): Simplify; when visiting an archive file switch to
1166 corresponding Todos file; use todos-first-visit.
1167 (todos-view-archived-items): Simplify; call todos-category-number.
1168 (todos-show-archive): Rename from todos-switch-to-archive and
1169 adjust callers; simplify.
1170 (todos-toggle-display-date-time): Add optional argument to toggle
1171 display in entire file.
1172 (todos-top-priorities): Use todos-filter-items, which now contains
1173 the previous core of this command.
1174 (todos-merged-top-priorities, todos-diary-items):
1175 Use todos-filter-items.
1176 (todos-forward-category): Add optional argument to go to the
1177 previous category.
1178 (todos-backward-category): Use todos-forward-category.
1179 (todos-jump-to-category): Refine implementation.
1180 (todos-forward-item, todos-backward-item): Fix movement from todo
1181 to done item and vice versa.
1182 (todos-add-file): Remove argument and simplify.
1183 (todos-rename-category): Use todos-current-todos-file and
1184 todos-mode-line-function; set todos-categories with
1185 todos-set-categories.
1186 (todos-delete-category): Ask what to do if category has archived items.
1187 (todos-raise-category): Ensure modified todos-categories is added
1188 to file's categories sexp.
1189 (todos-move-category): Improve implementation, especially handling
1190 of archived categories.
1191 (todos-merge-category): Tweak; set item counts.
1192 (todos-insert-item): Improve handling of various argument values;
1193 add new argument values to control marking of diary items and to
1194 use region for item body.
1195 (todos-insert-item-from-calendar): Use todos-global-current-todos-file.
1196 (todos-delete-item, todos-edit-item-header): Handle marked items.
1197 (todos-edit-item): Incorporate functionality of removed
1198 todos-string-multiline-p.
1199 (todos-edit-multiline): Use set-window-buffer instead of
1200 switch-to-buffer.
1201 (todos-edit-quit): Don't save on quitting; use todos-show instead
1202 of todos-category-select.
1203 (todos-raise-item-priority): Add argument to lower priority;
1204 improve handling of top priority items in todos-filter-items-mode;
1205 restore marks.
1206 (todos-lower-item-priority): Use todos-raise-item-priority.
1207 (todos-set-item-priority): Increment maximum number if item is new.
1208 (todos-move-item): Handle marked items; delay changing category
1209 moved from till after movement to avoid restoring if user cancels
1210 before insertion.
1211 (todos-item-done): Add optional argument to insert comment; fix
1212 item counts and update sexp.
1213 (todos-item-undo): Fix item counts and update.
1214 (todos-archive-done-item-or-items): Rename from
1215 todos-archive-done-items; add optional argument to archive all
1216 items in category; handle marked items.
1217 (todos-unarchive-category): Use todos-unarchive-items.
1218 (todos-toggle-diary-inclusion): Incorporate functionality of
1219 removed todos-toggle-item-diary-inclusion; handle marked items.
1220 (todos-print): Add optional argument to print to file.
1221 (todos-done-string-start): Don't use todos-nondiary-start.
1222 (todos-date-string-matcher, todos-time-string-matcher)
1223 (todos-done-string-matcher, todos-category-string-matcher): Rename
1224 from *-match and adjust callers.
1225 (todos-wrap-and-indent): Use set instead of setq for local variables.
1226 (todos-prefix-overlays): Improve overlay handling.
1227 (todos-reset-categories): Fix and complete implementation.
1228 (todos-toggle-show-current-file): Rename from
1229 todos-toggle-switch-todos-file-noninteractively.
1230 (todos-category-select): Use todos-mode-line-function.
1231 (todos-item-start): Comment out code used by removed function.
1232 (todos-remove-item): Handle presence of both prefix/number and
1233 mark overlays.
1234 (todos-get-count): Simplify.
1235 (todos-set-count): Change argument list and adjust callers; simplify.
1236 (todos-set-categories): Handle new archive files; use
1237 todos-categories-full and todos-ignore-archived-categories.
1238 (todos-truncate-categories-list): Use todos-categories-full.
1239 (todos-update-categories-sexp): Use kill-region instead of
1240 kill-line; use todos-categories-full.
1241 (todos-read-file-name): Add argument to require existing file and
1242 adjust callers; use file-truename.
1243 (todos-read-category): Remove argument to require existing
1244 category and delegate it to completing-read in function body.
1245 (todos-validate-category-name): Make empty string prompt only for
1246 initial category name.
1247 (todos-read-date): Use = instead of eq for testing if month = 13,
1248 and if it is, set monthname to *.
1249 (todos-display-categories): Use todos-global-current-todos-file;
1250 use set-window-buffer instead of switch-to-buffer; add a line
1251 showing item count totals.
1252 (todos-padded-string): Use the longest of category name or label.
1253 (todos-descending-counts): Rename from
1254 todos-descending-counts-store and adjust users.
1255 (todos-insert-category-line): Adjust format; use mapconcat; kill
1256 buffer after jumping to category.
1257
12582012-09-18 Stephen Berman <stephen.berman@gmx.net>
1259
1260 Changes from 2011-05-16 (revision 109996).
1261 * calendar/todos.el Add and revise various doc strings, remove
1262 further commented out code; add further comments; further code
1263 rearrangement.
1264 (todos-file-do, todos-archive-file, todos-mode-hook)
1265 (todos-edit-mode-hook, todos-exclusion-start, todos-exclusion-end)
1266 (todos-view-archive, todos-search-string)
1267 (todos-jump-to-category-noninteractively, todos-initial-setup):
1268 Remove.
1269 (todos-files): Remove this defcustom.
1270 (todos-initial-category, todos-display-categories-first)
1271 (todos-auto-switch-todos-file, todos-default-todos-file)
1272 (todos-categories-category-label, todos-categories-todo-label)
1273 (todos-categories-diary-label, todos-categories-done-label)
1274 (todos-categories-archived-label)
1275 (todos-categories-number-separator, todos-categories-align)
1276 (todos-ignore-archived-categories, todos-nondiary-marker):
1277 New defcustoms.
1278 (todos-prefix, todos-done-separator, todos-file-top)
1279 (todos-categories-buffer, todos-archived-categories-buffer)
1280 (todos-edit-buffer, todos-always-add-time-string, todos-button):
1281 Change default value.
1282 (todos-done-string): Add todos-reset-done-string as :set function,
1283 but keep this commented out.
1284 (todos-files, todos-archives, todos-insertion-map)
1285 (todos-category-done, todos-nondiary-start, todos-nondiary-end)
1286 (todos-show-done-only, todos-date-string-start)
1287 (todos-done-string-start): New variables.
1288 (todos-files-directory, todos-files-function, todos-merged-files)
1289 (todos-prompt-merged-files, todos-files, todos-modes-set-1)
1290 (todos-modes-set-2, todos-reset-done-string, todos-reset-categories)
1291 (todos-toggle-switch-todos-file-noninteractively)
1292 (todos-switch-todos-file, todos-counts, todos-get-count)
1293 (todos-set-count, todos-set-categories)
1294 (todos-truncate-categories-list, todos-update-categories-sexp)
1295 (todos-read-file-name, todos-sort, todos-display-sorted)
1296 (todos-label-to-key, todos-insert-sort-button): New functions.
1297 (todos-display-categories-sorted-by-todo)
1298 (todos-display-categories-sorted-by-diary)
1299 (todos-display-categories-sorted-by-done)
1300 (todos-display-categories-sorted-by-archived)
1301 (todos-update-merged-files, todos-switch-to-archive)
1302 (todos-choose-archive, todos-merged-top-priorities)
1303 (todos-jump-to-category-other-file, todos-clear-matches)
1304 (todos-add-file, todos-change-default-file, todos-move-category)
1305 (todos-merge-category, todos-merge-categories)
1306 (todos-edit-item-time, todos-move-item-to-file)
1307 (todos-unarchive-category, todos-toggle-item-diary-nonmarking)
1308 (todos-toggle-diary-nonmarking): New commands.
1309 (todos-toggle-show-done-only): New command replacing todos-view-archive.
1310 (todos-faces): New defgroup; use in all face definitions.
1311 (todos-sorted-column, todos-archived-only, todos-search): New faces.
1312 (todos-font-lock-keywords): Use subexpression 1 with matcher
1313 todos-category-string-match.
1314 (todos-mode-map, todos-archive-mode-map, todos-edit-mode-map)
1315 (todos-categories-mode-map): Add new key bindings; change some
1316 existing bindings.
1317 (todos-top-priorities-mode-map): New keymap.
1318 (todos-menu): Add submenues and new entries.
1319 (auto-mode-alist): Add extension of Todos and Todos archive files.
1320 (todos-mode, todos-archive-mode): Make derived mode; use
1321 todos-modes-set-1, todos-modes-set-2, todos-auto-switch-todos-file
1322 and todos-switch-todos-file; make todos-show-done-only local
1323 variable.
1324 (todos-edit-mode): Make derived mode; use todos-modes-set-1.
1325 (todos-categories-mode): Make derived mode.
1326 (todos-top-priorities-mode): New derived major mode.
1327 (todos-save): Remove unused code.
1328 (todos-quit): Handle todos-categories-mode; save archive buffer.
1329 (todos-show): Add optional argument to prompt for a Todos file; if
1330 called interactively or with prefix arg or from an archive, don't
1331 make a no-op but reset todos-current-todos-file, todos-categories
1332 and todos-category-number; use todos-read-file-name,
1333 todos-display-categories-first, todos-ignore-archived-categories.
1334 (todos-display-categories): Change argument name; refactor code
1335 for inserting table labels and lines, using
1336 todos-ignore-archived-categories, todos-sort,
1337 todos-categories-number-separator, todos-insert-sort-button,
1338 todos-categories-*-labels, and todos-insert-category-line.
1339 (todos-display-categories-alphabetically): Use todos-display-sorted.
1340 (todos-toggle-view-done-items): Use todos-done-string-start and
1341 todos-get-count.
1342 (todos-toggle-display-date-time): Use todos-done-string-start.
1343 (todos-top-priorities): Remove autoload cookie; partially rewrite:
1344 new argument list; allow combining top priorities of multiple
1345 Todos files; change display to include category (and file) name as
1346 part of item header; use todos-top-priorities-mode.
1347 (todos-diary-items): Reimplement using only todos-top-priorities.
1348 (todos-forward-category, todos-backward-category): Adjust to
1349 1-based numbering of categories; move point to top of category.
1350 (todos-jump-to-category): Rewrite, adding optional arguments to
1351 provide a category in non-interactive uses and to prompt for which
1352 Todos file to jump to.
1353 (todos-search): Reimplement; highlight each match as found, say
1354 how many matches remain and prompt whether to go to next one; at
1355 end of search prompt whether to remove highlighting.
1356 (todos-add-category): Remove autoload cookie; assign new category
1357 the highest category number; associate zero-initialized vector of
1358 item counts, instead of property list, with new category; use
1359 todos-validate-category-name and todos-update-categories-sexp.
1360 (todos-rename-category): Use todos-validate-category-name and
1361 todos-update-categories-sexp; take archive files into account.
1362 (todos-delete-category): Use todos-get-count and
1363 todos-update-categories-sexp, let-bind variable that were
1364 mistakenly global; use delete-region instead of kill-region;
1365 adjust to 1-based numbering of categories; move point to top of
1366 category.
1367 (todos-raise-category): Handle item count vectors; use
1368 todos-insert-category-line and todos-update-categories-sexp.
1369 (todos-insert-item): Use nil time-string argument to omit time
1370 string; use todos-nondiary-start and todos-nondiary-end and
1371 todos-update-categories-sexp; if category named to insert into
1372 does not exist, add it; take new diary items into account.
1373 (todos-insert-item-ask-date, todos-insert-item-ask-date-time)
1374 (todos-insert-item-ask-date-time-for-diary)
1375 (todos-insert-item-ask-date-time-for-diary-here)
1376 (todos-insert-item-ask-date-time-here)
1377 (todos-insert-item-ask-date-maybe-notime)
1378 (todos-insert-item-ask-date-maybe-notime-for-diary)
1379 (todos-insert-item-ask-date-maybe-notime-for-diary-here)
1380 (todos-insert-item-ask-date-maybe-notime-here)
1381 (todos-insert-item-ask-date-for-diary)
1382 (todos-insert-item-ask-date-for-diary-here)
1383 (todos-insert-item-ask-date-here, todos-insert-item-ask-dayname)
1384 (todos-insert-item-ask-dayname-time)
1385 (todos-insert-item-ask-dayname-time-for-diary)
1386 (todos-insert-item-ask-dayname-time-for-diary-here)
1387 (todos-insert-item-ask-dayname-time-here)
1388 (todos-insert-item-ask-dayname-maybe-notime)
1389 (todos-insert-item-ask-dayname-maybe-notime-for-diary)
1390 (todos-insert-item-ask-dayname-maybe-notime-for-diary-here)
1391 (todos-insert-item-ask-dayname-maybe-notime-here)
1392 (todos-insert-item-ask-dayname-for-diary)
1393 (todos-insert-item-ask-dayname-for-diary-here)
1394 (todos-insert-item-ask-dayname-here, todos-insert-item-ask-time)
1395 (todos-insert-item-ask-time-for-diary)
1396 (todos-insert-item-ask-time-for-diary-here)
1397 (todos-insert-item-ask-time-here)
1398 (todos-insert-item-maybe-notime)
1399 (todos-insert-item-maybe-notime-for-diary)
1400 (todos-insert-item-maybe-notime-for-diary-here)
1401 (todos-insert-item-maybe-notime-here)
1402 (todos-insert-item-for-diary, todos-insert-item-for-diary-here):
1403 New insertion commands.
1404 (todos-insert-item-from-calendar): Use todos-current-todos-file.
1405 (todos-delete-item): Handle diary items;
1406 use todos-update-categories-sexp.
1407 (todos-edit-item): Check if point is with item string;
1408 use read-string instead of read-from-minibuffer;
1409 use todos-date-string-start; after editing put point at start of
1410 item text.
1411 (todos-edit-multiline): Narrow to item before invoking
1412 todos-edit-mode; show key binding of todos-edit-quit in a message.
1413 (todos-edit-quit): Use todos-save; kill buffer.
1414 (todos-edit-item-header): Add optional argument to prompt for
1415 editing only date string or only time string;
1416 use todos-date-string-start.
1417 (todos-edit-item-date, todos-edit-item-date-is-today)
1418 (todos-raise-item-priority, todos-lower-item-priority): Rename
1419 from todos-{raise, lower}-item and make them DTRT in
1420 todos-top-priorities-mode.
1421 (todos-set-item-priority): Make interactive; use todos-get-count
1422 and todos-insert-with-overlays; interactively, just relocate the
1423 item within its category.
1424 (todos-move-item): Add optional argument to prompt for a category
1425 in another Todos file; handle diary items; fix restoration after
1426 cancelling before inserting.
1427 (todos-item-done): Handle diary items; simplify handling of
1428 insertion in done items section.
1429 (todos-item-undo): Handle diary items.
1430 (todos-archive-done-items): Adjust to new handling of archive
1431 files (in parallel with Todos files); handle diary items; use
1432 todos-done-string-start.
1433 (todos-toggle-item-diary-inclusion): Use todos-nondiary-start,
1434 todos-nondiary-end and todos-item-counts.
1435 (todos-toggle-diary-inclusion): Use todos-category-done instead of
1436 todos-category-end.
1437 (todos-print): Remove autoload cookie; rewrite to make overlays,
1438 line wrapping and wrap prefixes printable.
1439 (todos-date-pattern): Make parenthesized groups shy.
1440 (todos-date-string-match): Use todos-date-string-start; make
1441 todos-date-pattern an explicitly numbered group.
1442 (todos-time-string-match): Use todos-date-string-start.
1443 (todos-done-string-match): Use todos-done-string-start.
1444 (todos-category-string-match): Rewrite to match new category and
1445 category+filename patterns in todos-top-priorities-mode.
1446 (todos-prefix-overlays): Use todos-done-string-start and
1447 todos-category-done.
1448 (todos-reset-prefix): Handle archive files; restore point after
1449 changing prefix.
1450 (todos-reset-separator): Handle archive files.
1451 (todos-category-number): Make category number one more than its
1452 list index.
1453 (todos-current-category): Adjust to 1-based numbering of categories.
1454 (todos-category-select): Simplify handling of done items and done
1455 separator string overlay.
1456 (todos-item-start): Use todos-date-string-start and
1457 todos-done-string-start.
1458 (todos-item-start, todos-item-end): Fix wrong parenthesizing.
1459 (todos-item-string): Restore point after getting item bounds; use
1460 buffer-substring-no-properties.
1461 (todos-done-item-p): Use todos-done-string-start.
1462 (todos-make-categories-list): Add optional argument to force
1463 looping through file to get categories and their item counts,
1464 otherwise set todos-categories from sexp in first line; use
1465 vectors of item counts instead of plists; count diary items.
1466 (todos-item-counts): Use todos-counts, todos-set-counts,
1467 todos-get-counts, and todos-update-categories-sexp instead of
1468 getting and setting properties; handle diary items.
1469 (todos-read-category): Add argument to set prompt; don't offer
1470 default category.
1471 (todos-validate-category-name): Rename from
1472 todos-check-category-name; take into account whether there are
1473 already categories or not.
1474 (todos-read-date): Accept `*' as an unspecified month, day, or year.
1475 (todos-padded-string): Accommodate new structure of
1476 todos-categories as alists; use todos-categories-align.
1477 (todos-descending-counts-store): New variable.
1478 (todos-insert-category-line): Rename from
1479 todos-insert-category-name and reimplement using labels and
1480 todos-get-counts instead of properties; use
1481 todos-ignore-archived-categories; highlight sorted column.
1482
14832012-09-14 Stephen Berman <stephen.berman@gmx.net>
1484
1485 Changes from 2010-07-09 (revision 109995).
1486 * calendar/todos.el Remove lots of commented out code; add various
1487 comments; further code rearrangement.
1488 (todos-insert-item-here-ask-date-time)
1489 (todos-insert-item-ask-date-time)
1490 (todos-insert-item-ask-dayname-time)
1491 (todos-insert-item-for-diary)
1492 (todos-insert-item-for-diary-ask-date-time)
1493 (todos-make-categories-alist, todos-categories-alist): Remove.
1494 (todos-categories-list): Comment out.
1495 (todos-make-categories-list): New function replacing
1496 todos-make-categories-alist, using category plists to get item
1497 counts and taking archive into account.
1498 (todos-current-todos-file): New variable.
1499 (todos-mode-map): Update key bindings.
1500 (todos-save): Add as comment code to make sure todos-categories
1501 sexp is current on saving.
1502 (todos-quit): Call todos-show on quitting Todos archive buffer.
1503 (todos-show): If todos-current-todos-file is not set to Todos
1504 file, set it as a new file; set todos-categories from
1505 todos-make-categories-alist.
1506 (todos-display-categories): Use a different display format for
1507 archive file; put point initially on the first button.
1508 (todos-toggle-view-done-items): Check the category's `done'
1509 property to determine if there are done items.
1510 (todos-view-archive): Set todos-current-todos-file to the archive
1511 file; jump from the Todos file to the same category in the
1512 archive, if it exists, else jump to the first category; use
1513 message instead of error.
1514 (todos-add-category): Intern a special symbol for the new category
1515 and set its property list to holds counts of the numbers of todo,
1516 done and archived items in the category; assign the new category
1517 the current highest category number.
1518 (todos-rename-category): Don't use todos-categories-alist.
1519 (todos-delete-category): Check the category's `todo' and `done'
1520 properties to determine if it is empty; ensure that the end of the
1521 last category is found; after deleting the category, empty its
1522 plist and unintern its special symbol.
1523 (todos-insert-item-here): Fix argument list of todos-insert-item.
1524 (todos-delete-item, todos-raise-item, todos-lower-item):
1525 Use message instead of error.
1526 (todos-move-item): If the category to be moved to does not exist,
1527 add it as a new category.
1528 (todos-item-done, todos-reset-separator):
1529 Use todos-category-select instead of todos-show.
1530 (todos-archive-done-items): Make buffer writeable; conditionalize
1531 search for end of category; save after adding to archive in case
1532 the file is new, so it can be found.
1533 (todos-category-select): Wrap search in if instead of or+and;
1534 don't hide done items in an archive.
1535 (todos-set-item-priority): Check the category's `todo'
1536 property to determine if there are not done todo items.
1537 (todos-jump-to-category-noninteractively): Just switch to buffer
1538 visiting todos-current-todos-file, since this can be either a
1539 Todos file or an archive.
1540 (todos-item-counts): Use category's plist instead of an alist.
1541 (todos-longest-category-name-length): Argument is now a list of
1542 category names, not an alist, so just test each element, not each
1543 element's the car.
1544 (todos-padded-string): Use todos-categories instead of
1545 todos-categories-alist.
1546 (todos-insert-category-name): Use category plist to get item
1547 counts; take archived items into account.
1548
15492012-09-13 Stephen Berman <stephen.berman@gmx.net>
1550
1551 Changes from 2010-06-18 (revision 109994).
1552 * calendar/todos.el: Numerous spelling and comment fixes, doc
1553 string fixes to conform with checkdoc, further rearrangement of
1554 definitions, etc.
1555 (todos-previous-line, todos-previous-answer)
1556 (todos-insert-item-ask-date, todos-change-date)
1557 (todos-date-nodayname-pattern, todos-dayname-date-pattern)
1558 (todos-count-items-in-category, todos-count-all-items): Remove.
1559 (todos-update-numbered-prefix, todos-item-start-overlays)
1560 (todos-add-item-non-interactively): Comment out, also in uses.
1561 (todos-done-separator): Change default value.
1562 (todos-always-add-time-string): Rename from todos-add-time-string
1563 and adjust uses.
1564 (todos-read-category): Rename from todos-completing-read and
1565 adjust callers; use todos-current-category.
1566 (todos-make-categories-alist): Rename from function
1567 todos-categories-alist.
1568 (todos-categories-alist): New variable.
1569 (todos-indent-to-here): New defcustom.
1570 (todos-button): New face.
1571 (todos-display-categories-alphabetically, todos-raise-category)
1572 (todos-lower-category, todos-insert-item-for-diary-ask-date-time)
1573 (todos-insert-item-here-ask-date-time)
1574 (todos-insert-item-ask-date-time)
1575 (todos-insert-item-ask-dayname-time): New commands.
1576 (todos-edit-item-header): New command replacing todos-change-date.
1577 (todos-category-number, todos-indent, todos-item-counts)
1578 (todos-check-category-name, todos-read-date, todos-read-dayname)
1579 (todos-read-time, todos-padded-string)
1580 (todos-insert-category-name): New functions.
1581 (todos-set-item-priority): New function replacing
1582 todos-add-item-non-interactively.
1583 (todos-mode-map): Remap newline to newline-and-indent.
1584 (todos-edit-mode-map): Make sparse keymap; remap newline to
1585 newline-and-indent.
1586 (todos-categories-mode-map): New keymap.
1587 (todos-mode, todos-edit-mode): Make indent-line-function local
1588 variable and set to todos-indent.
1589 (todos-categories-mode): New major mode.
1590 (todos-display-categories): List categories initially in their
1591 numerical order; add optional argument to switch to alphabetical
1592 listing.
1593 (todos-toggle-view-done-items): Simplify implementation.
1594 (todos-toggle-display-date-time): Fix regexp search string.
1595 (todos-backward-item, todos-forward-item): Use variable
1596 todos-item-start.
1597 (todos-add-category): Use todos-check-category-name and
1598 todos-categories-alist.
1599 (todos-rename-category): Use todos-current-category,
1600 todos-check-category-name and todos-categories-alist.
1601 (todos-delete-category): Use todos-check-category-name and
1602 todos-categories-alist and take done items into account.
1603 (todos-insert-item): Use separate arguments to handle insertion of
1604 date/dayname and time strings, add new argument to mark item for
1605 diary inclusion, use new todos-read-* functions,
1606 todos-set-item-priority and todos-item-counts.
1607 (todos-insert-item-here, todos-insert-item-for-diary)
1608 (todos-insert-item-from-calendar): Adapt to new version of
1609 todos-insert-item.
1610 (todos-delete-item, todos-item-done): Use todos-item-counts.
1611 (todos-edit-item): Indent newlines inserted by C-q C-j if nonspace
1612 char follows.
1613 (todos-lower-item): Ensure only not-done items can be lowered.
1614 (todos-move-item): Use todos-current-category, todos-read-category
1615 and todos-item-counts.
1616 (todos-archive-done-items): Use todos-current-category and
1617 todos-item-counts; fix regexp search string.
1618 (todos-item-undo): Use todos-current-category,
1619 todos-set-item-priority, todos-insert-with-overlays and
1620 todos-item-counts; restore if user quits before inserting undone
1621 item.
1622 (todos-date-pattern): Rewrite without using
1623 todos-date-nodayname-pattern and todos-dayname-date-pattern.
1624 (todos-date-string-match): Do not make todos-date-pattern an
1625 unnumbered group.
1626 (todos-time-string-match): Make todos-date-pattern a shy group.
1627 (todos-wrap-and-indent): Use todos-indent-to-here.
1628 (todos-reset-prefix): Revert to using todos-show instead of
1629 todos-category-select.
1630 (todos-prefix-overlays): Fix numbering of done items and updating
1631 of prefix.
1632 (todos-category-select): Use todos-current-category; fix display
1633 of separator string; don't move point to top of category.
1634 (todos-jump-to-category-noninteractively): Use todos-category-number.
1635 (todos-insert-with-overlays): Use todos-item-start unconditionally.
1636 (todos-item-start): New variable.
1637 (todos-item-start): Use it to define this function.
1638 (todos-item-end): Adjust if item is last unfinished one before
1639 displayed done items.
1640 (todos-remove-item): Use todos-item-start and todos-item-end
1641 instead of todos-forward-item and todos-backward-item.
1642 (todos-longest-category-name-length): Add argument for list of
1643 categories.
1644
16452012-09-13 Stephen Berman <stephen.berman@gmx.net>
1646
1647 Changes from 2010-05-25 (revision 109993).
1648 * calendar/todos.el: Comment out calendar require, since diary-lib
1649 requires calendar. Rearrange file to group definitions according
1650 to their use (types of commands, internal functions, etc.)
1651 (todos-file-done, todos-insert-threshold, todos-remove-separator)
1652 (todos-date-string, todos-time-string, todos-check-overlay)
1653 (todos-show-paren-hack, todos-file-item, todos-more-important-p):
1654 Comment out.
1655 (todos-current-date, todos-item-end-overlays)
1656 (todos-list-categories): Remove.
1657 (todos-item-end): Remove (the variable, not the function).
1658 (todos-prefix-overlays): Rename from todos-item-overlays and adjust
1659 callers.
1660 (todos-done-separator, todos-done-string, todos-show-with-done)
1661 (todos-files, todos-archive-file, todos-categories-buffer)
1662 (todos-archived-categories-buffer, todos-wrap-lines)
1663 (todos-line-wrapping-function): New defcustoms.
1664 (todos-done, todos-done-sep): New faces.
1665 (todos-done-face, todos-done-sep-face): Corresponding new variables.
1666 (todos-search-string, todos-date-nodayname-pattern)
1667 (todos-dayname-date-pattern, todos-date-pattern): New variables.
1668 (todos-done-string-match, todos-category-string-match)
1669 (todos-check-format, todos-wrap-and-indent, todos-reset-separator)
1670 (todos-current-category, todos-count-items-in-category)
1671 (todos-done-item-p, todos-categories-alist, todos-count-all-items)
1672 (todos-longest-category-name-length): New functions.
1673 (todos-categories-list): New buffer-specific function replacing
1674 todos-list-categories.
1675 (todos-toggle-item-numbering, todos-toggle-view-done-items)
1676 (todos-search, todos-view-archive, todos-diary-items)
1677 (todos-toggle-display-date-time, todos-insert-item-no-time)
1678 (todos-insert-item-ask-date, todos-insert-item-for-diary)
1679 (todos-insert-item-from-calendar, todos-edit-quit)
1680 (todos-change-date, todos-item-done, todos-archive-done-items)
1681 (todos-item-undo): New commands.
1682 (todos-archive-mode): New major mode.
1683 (todos-archive-mode-map, todos-edit-mode-map): New keymaps.
1684 (todos-category-beg): Change value.
1685 (todos-number-prefix): Change default value.
1686 (todos-edit-buffer): Change from defvar to defcustom.
1687 (todos-font-lock-keywords): Use todos-done-string-match and
1688 todos-category-string-match.
1689 (todos-backward-item, todos-forward-item): Use todos-done-string
1690 and todos-date-pattern.
1691 (todos-display-categories): Reimplement using buttons from
1692 button.el instead of widgets.
1693 (todos-top-priorities): Use with-current-buffer; take done items
1694 into account; ensure buffers gets fontified.
1695 (todos-add-category): Ensure new category does not begin with
1696 empty lines.
1697 (todos-jump-to-category): Use todos-category-select instead of
1698 todos-show.
1699 (todos-rename-category): Prompt for new name in body instead of in
1700 interactive spec.
1701 (todos-insert-item): Don't insert in done items section of
1702 category. Add two optional arguments to control insertion: (i) to
1703 insert near point without prompting for priority; (ii) to use
1704 defaults for date and time strings, to prompt for these, or to
1705 choose date from the Calendar.
1706 (todos-insert-item-here): Reimplement using todos-insert-item.
1707 (todos-delete-item): Don't move point after deleting last item.
1708 (todos-raise-item, todos-lower-item): Take done items into account.
1709 (todos-move-item): Don't move done items; update item numbering;
1710 restore if user quits before inserting moved item.
1711 (todos-print): Prompt for confirmation to print.
1712 (todos-reset-prefix): Search backward from end of file instead of
1713 forward from top.
1714 (todos-jump-to-category-noninteractively): Take Todos archive into
1715 account.
1716 (todos-category-select): Show or hide done items according to
1717 todos-show-with-done; if shown, coordinate separator and prefix
1718 overlays.
1719 (todos-add-item-non-interactively): Replace binary insertion
1720 algorithm with prompting for numerical priority.
1721 (todos-insert-with-overlays): Remove use of variable todos-item-end.
1722 (todos-item-start): Take done items into account; use
1723 todos-date-pattern.
1724 (todos-item-end): Reimplement using todos-forward-item.
1725 (todos-remove-item): Reimplement using todos-forward-item and
1726 todos-backward-item; redo overlay handling.
1727 (todos-mode-map): Add some new key bindings and change numerous
1728 existing bindings; use "i" as prefix key for item insertion
1729 commands.
1730 (todos-mode): Use todos-wrap-lines and delegate word-wrap and
1731 wrap-prefix settings to todos-wrap-and-indent; add to invisibility
1732 spec; set buffer-read-only to t and consequently let-bind this
1733 variable in all Todos commands that change buffer content.
1734 (todos-edit-mode): Make an indepent mode, not derived from text-mode.
1735 (todos-save): Don't save top priorities buffer.
1736 (todos-show): Make a no-op if called interactively in narrowed
1737 Todos mode, since, also to work around item prefix reduplication
1738 bug with show-paren-mode enabled; use todos-categories-list.
1739
17402012-09-12 Stephen Berman <stephen.berman@gmx.net>
1741
1742 Changes from 2009-11-07 (revision 109992).
1743 * calendar/todos.el: Comment out time-stamp require; require
1744 calendar and diary-lib.
1745 (todos-prefix): Change default value and doc string to reflect new
1746 meaning; add :initialize and :set functions.
1747 (todos-time-string-format, todos-entry-prefix-function)
1748 (todos-initials, todos-entry-timestamp-initials)
1749 (todos-prefix-face, todos-category-sep, todos-category-end)
1750 (todos-cp): Comment out.
1751 (todos-prefix-string): Inherit from font-lock-comment-face.
1752 (todos-item-header, todos-item-header-face): Remove.
1753 (todos-date, todos-time): New faces.
1754 (todos-date-face, todos-time-face): Corresponding new variables.
1755 (todos-add-time-string, todos-include-in-diary)
1756 (todos-exclusion-start, todos-exclusion-end, todos-number-prefix):
1757 New defcustoms.
1758 (todos-item-end, todos-item-start-overlays)
1759 (todos-item-end-overlays): New variables.
1760 (todos-date-string-match, todos-time-string-match): New functions.
1761 (todos-font-lock-keywords): Use them.
1762 (todos-current-date, todos-date-string, todos-time-string)
1763 (todos-toggle-item-diary-inclusion, todos-toggle-diary-inclusion)
1764 (todos-reset-prefix, todos-update-numbered-prefix)
1765 (todos-check-overlay, todos-item-overlays)
1766 (todos-insert-with-overlays, todos-show-paren-hack): New functions.
1767 (todos-highlight-item): New command.
1768 (todos-category-beg): Change value.
1769 (todos-category-select): Use todos-category-beg and todos-item-overlays.
1770 (todos-backward-item): Add optional count argument; use it and
1771 todos-item-start.
1772 (todos-forward-item): Use todos-check-overlay, todos-item-start
1773 and variable todos-item-end.
1774 (todos-edit-item, todos-delete-item): Use todos-number-prefix,
1775 todos-update-numbered-prefix, todos-item-overlays.
1776 (todos-add-category, todos-rename-category)
1777 (todos-list-categories): Use new category format.
1778 (todos-delete-category): Allow deleting non-empty category;
1779 use new category format.
1780 (todos-add-item-non-interactively): Comment out unnecessary
1781 save-excursion; use todos-insert-with-overlays.
1782 (todos-insert-item): Comment out unnecessary save-excursion; use
1783 new item format for date/time header and diary inclusion marking.
1784 (todos-insert-item-here): Use new item format for date/time header
1785 and diary inclusion marking; use todos-insert-with-overlays.
1786 (todos-raise-item): Make a no-op if point is on an empty line; use
1787 todos-insert-with-overlays.
1788 (todos-lower-item): Use todos-insert-with-overlays.
1789 (todos-top-priorities): Move call to todos-show inside
1790 save-excursion; add save-current-buffer after save-restriction.
1791 (todos-item-start): Use variable todos-item-end.
1792 (todos-item-end): Use todos-check-overlay and variable todos-item-end.
1793 (todos-remove-item): Take item overlays into account.
1794 (todos-mode): Change calculation of wrap-prefix; make
1795 hl-line-range-function a local variable and set it to highlight
1796 todo item.
1797 (todos-show): Ensure point stays at top of category.
1798
17992012-09-12 Stephen Berman <stephen.berman@gmx.net>
1800
1801 Changes from 2009-07-04 (revision 109991).
1802 * calendar/todos.el (todos-window-configuration): Comment out.
1803 (todos-display-categories): Comment out use of
1804 todos-window-configuration; use switch-to-buffer instead of
1805 pop-to-buffer.
1806 (todos-jump-to-category-noninteractively): Comment out use of
1807 todos-window-configuration.
1808 (todos-edit-item): Don't allow editing of date/time item header.
1809 (todos-insert-item, todos-insert-item-here): Insert date/time
1810 header in front of new item string.
1811 (todos-mode): Tweak wrap-prefix.
1812
18132012-09-12 Stephen Berman <stephen.berman@gmx.net>
1814
1815 Changes from 2009-06-26 (revision 109989).
1816 * calendar/todos.el (todos-file-do, todos-file-done):
1817 Change default location to directory "~/.emacs.d/".
1818 (todos-completion-ignore-case, todos-categories-buffer):
1819 New defcustoms.
1820 (todos-prefix-string, todos-item-header): New faces.
1821 (todos-prefix-face, todos-item-header-face): Corresponding
1822 new variables.
1823 (todos-rename-category, todos-delete-category)
1824 (todos-display-categories, todos-move-item): New commands.
1825 (todos-mode-map): Add key bindings for new commands and for
1826 todos-add-category, which had no key binding.
1827 (todos-jump-to-category-noninteractively): New function.
1828 (todos-top-priorities): Comment out code using a previously
1829 deleted variable.
1830 (todos-completing-read): Allow SPC to insert a space when entering
1831 a new category name; use todos-completion-ignore-case.
1832 (todos-font-lock-keywords, todos-window-configuration):
1833 New variables.
1834 (todos-mode): Make mode-name "TODOS"; make font-lock-defaults,
1835 word-wrap, and wrap-prefix local variables.
1836
18372012-09-12 Stephen Berman <stephen.berman@gmx.net>
1838
1839 Changes from 2009-02-16 (revision 109988).
1840 * calendar/todos.el (todos-list-categories): Fix typos.
1841 (todos-show): Ensure file is in todos-mode.
1842
18432012-09-12 Stephen Berman <stephen.berman@gmx.net>
1844
1845 Changes from 2009-02-12 (revision 109987).
1846 * calendar/todos.el (todos-header): Remove defvar.
1847 (todos-add-category): Comment out code that inserts and updates
1848 the file local variables first line of the file todos-file-do.
1849 (todos-list-categories): New function.
1850 (todos-show): Use it; remove use of a previously deleted variable.
1851
18522012-09-11 Stephen Berman <stephen.berman@gmx.net>
1853
1854 Changes from 2009-02-12 (revision 109986).
1855 * calendar/todos.el: New file. This is a copy of todo-mode.el
1856 from revision 94343 except for the following changes: replace all
1857 occurrences of the namespace prefix "todo-" with "todos-", delete
1858 the defvar todo-cats (the old name of todo-categories) and its use
1859 in todos-add-category, delete all defaliases of old command names.
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el
index 350a957c6e4..628af73a9b1 100644
--- a/lisp/calendar/todos.el
+++ b/lisp/calendar/todos.el
@@ -143,7 +143,9 @@ displayed correctly."
143 "What action to take on first use of `todos-show' on a file." 143 "What action to take on first use of `todos-show' on a file."
144 :type '(choice (const :tag "Show first category" first) 144 :type '(choice (const :tag "Show first category" first)
145 (const :tag "Show table of categories" table) 145 (const :tag "Show table of categories" table)
146 (const :tag "Show top priorities" top)) 146 (const :tag "Show top priorities" top)
147 (const :tag "Show diary items" diary)
148 (const :tag "Show regexp items" regexp))
147 :group 'todos) 149 :group 'todos)
148 150
149(defcustom todos-completion-ignore-case nil 151(defcustom todos-completion-ignore-case nil
@@ -496,26 +498,6 @@ current time, if nil, they include it."
496 :version "24.2" 498 :version "24.2"
497 :group 'todos) 499 :group 'todos)
498 500
499(defcustom todos-filtered-items-buffer "Todos filtered items"
500 "Initial name of buffer in Todos Filter Items mode."
501 :type 'string
502 :group 'todos-filtered)
503
504(defcustom todos-top-priorities-buffer "Todos top priorities"
505 "Buffer type string for `todos-filtered-buffer-name'."
506 :type 'string
507 :group 'todos-filtered)
508
509(defcustom todos-diary-items-buffer "Todos diary items"
510 "Buffer type string for `todos-filtered-buffer-name'."
511 :type 'string
512 :group 'todos-filtered)
513
514(defcustom todos-regexp-items-buffer "Todos regexp items"
515 "Buffer type string for `todos-filtered-buffer-name'."
516 :type 'string
517 :group 'todos-filtered)
518
519(defcustom todos-priorities-rules nil 501(defcustom todos-priorities-rules nil
520 "List of rules giving how many items `todos-top-priorities' shows. 502 "List of rules giving how many items `todos-top-priorities' shows.
521This variable should be set interactively by 503This variable should be set interactively by
@@ -1078,6 +1060,8 @@ short Todos Archive or Top Priorities file name, respectively."
1078 (concat todos-files-directory name 1060 (concat todos-files-directory name
1079 (cond ((eq type 'archive) ".toda") 1061 (cond ((eq type 'archive) ".toda")
1080 ((eq type 'top) ".todt") 1062 ((eq type 'top) ".todt")
1063 ((eq type 'diary) ".tody")
1064 ((eq type 'regexp) ".todr")
1081 (t ".todo")))))) 1065 (t ".todo"))))))
1082 1066
1083(defun todos-check-format () 1067(defun todos-check-format ()
@@ -1940,15 +1924,64 @@ the empty string (i.e., no time string)."
1940 (message "Click \"Apply\" after selecting files.") 1924 (message "Click \"Apply\" after selecting files.")
1941 (recursive-edit)) 1925 (recursive-edit))
1942 1926
1943(defun todos-filter-items (filter file-list) 1927(defun todos-filter-items (filter &optional new multifile)
1944 "Display a list of items from FILE-LIST that satisfy FILTER. 1928 "Internal routine for displaying items that satisfy FILTER.
1945The values of FILE-LIST and FILTER are passed from the calling 1929The values of FILTER can be `top' for top priority items, a cons
1946commands. The files in FILE-LIST are either the current Todos 1930of `top' and a number passed by the caller, `diary' for diary
1947file or those listed in `todos-filter-files' or chosen 1931items, or `regexp' for items matching a regular expresion entered
1948interactively. The values of FILTER can be `top' for top 1932by the user. The items can be from any categories in the current
1949priority items, a cons of `top' and a number passed by the 1933todo file or, with non-nil MULTIFILE, from several files. If NEW
1950caller, `diary' for diary items, or `regexp' for items matching a 1934is nil, visit an appropriate file containing the list of filtered
1951regular expresion entered by the user." 1935items; if there is no such file, or with non-nil NEW, build the
1936list and display it.
1937
1938See the document strings of the commands `todos-top-priorities',
1939`todos-diary-items', `todos-regexp-items', and those of the
1940corresponding multifile commands for further details. "
1941 (let* ((top (eq filter 'top))
1942 (diary (eq filter 'diary))
1943 (regexp (eq filter 'regexp))
1944 (buf (cond (top todos-top-priorities-buffer)
1945 (diary todos-diary-items-buffer)
1946 (regexp todos-regexp-items-buffer)))
1947 (flist (if multifile
1948 (or todos-filter-files
1949 (progn (todos-multiple-filter-files)
1950 todos-multiple-filter-files))
1951 (list todos-current-todos-file)))
1952 (multi (> (length flist) 1))
1953 (fname (if (equal flist 'quit)
1954 ;; Pressed `cancel' in t-m-f-f file selection dialog.
1955 (keyboard-quit)
1956 (concat todos-files-directory
1957 (mapconcat 'todos-short-file-name flist "-")
1958 (cond (top ".todt")
1959 (diary ".tody")
1960 (regexp ".todr")))))
1961 (rxfiles (when regexp
1962 (directory-files todos-files-directory t ".*\\.todr$" t)))
1963 (file-exists (or (file-exists-p fname) rxfiles)))
1964 (cond ((and top new (natnump new))
1965 (todos-filter-items-1 (cons 'top new) flist))
1966 ((and (not new) file-exists)
1967 (when (and rxfiles (> (length rxfiles) 1))
1968 (let ((rxf (mapcar 'todos-short-file-name rxfiles)))
1969 (setq fname (todos-absolute-file-name
1970 (completing-read "Choose a regexp items file: "
1971 rxf) 'regexp))))
1972 (find-file fname)
1973 (todos-prefix-overlays)
1974 (todos-check-filtered-items-file))
1975 (t
1976 (todos-filter-items-1 filter flist)))
1977 (when (or new (not file-exists))
1978 (setq fname (replace-regexp-in-string "-" ", " fname))
1979 (rename-buffer (format (concat "%s for file" (if multi "s" "")
1980 " \"%s\"") buf fname)))))
1981
1982(defun todos-filter-items-1 (filter file-list)
1983 "Internal subroutine called by `todos-filter-items'.
1984The values of FILTER and FILE-LIST are passed from the caller."
1952 (let ((num (if (consp filter) (cdr filter) todos-show-priorities)) 1985 (let ((num (if (consp filter) (cdr filter) todos-show-priorities))
1953 (buf (get-buffer-create todos-filtered-items-buffer)) 1986 (buf (get-buffer-create todos-filtered-items-buffer))
1954 (multifile (> (length file-list) 1)) 1987 (multifile (> (length file-list) 1))
@@ -2143,27 +2176,26 @@ set the user customizable option `todos-priorities-rules'."
2143 (customize-save-variable 'todos-priorities-rules rules) 2176 (customize-save-variable 'todos-priorities-rules rules)
2144 (todos-prefix-overlays))) 2177 (todos-prefix-overlays)))
2145 2178
2146(defun todos-filtered-buffer-name (buffer-type file-list) 2179(defconst todos-filtered-items-buffer "Todos filtered items"
2147 "Rename Todos filtered buffer using BUFFER-TYPE and FILE-LIST. 2180 "Initial name of buffer in Todos Filter Items mode.")
2148 2181
2149The new name is constructed from the string BUFFER-TYPE, which 2182(defconst todos-top-priorities-buffer "Todos top priorities"
2150refers to one of the top priorities, diary or regexp item 2183 "Buffer type string for `todos-filter-items'.")
2151filters, and the names of the filtered files in FILE-LIST. Used 2184
2152in Todos Filter Items mode." 2185(defconst todos-diary-items-buffer "Todos diary items"
2153 (let* ((multi (> (length file-list) 1)) 2186 "Buffer type string for `todos-filter-items'.")
2154 (fnames (mapconcat (lambda (f) (todos-short-file-name f)) 2187
2155 file-list ", "))) 2188(defconst todos-regexp-items-buffer "Todos regexp items"
2156 (rename-buffer (format (concat "%s for file" (if multi "s" "") 2189 "Buffer type string for `todos-filter-items'.")
2157 " \"%s\"") buffer-type fnames))))
2158 2190
2159(defun todos-find-item (str) 2191(defun todos-find-item (str)
2160 "Search for saved top priority item STR in its Todos file. 2192 "Search for filtered item STR in its saved Todos file.
2161Return the list (FOUND FILE CAT), where CAT and FILE are the 2193Return the list (FOUND FILE CAT), where CAT and FILE are the
2162item's category and file, and FOUND is a cons cell if the search 2194item's category and file, and FOUND is a cons cell if the search
2163succeeds, whose car is the start of the item in FILE and whose 2195succeeds, whose car is the start of the item in FILE and whose
2164cdr is `done' if the item is now a done item, `changed' if its 2196cdr is `done', if the item is now a done item, `changed', if its
2165priority has changed or its text was truncated or augmented, and 2197text was truncated or augmented or, for a top priority item, if
2166`same' otherwise." 2198its priority has changed, and `same' otherwise."
2167 (string-match (concat (if todos-filter-done-items 2199 (string-match (concat (if todos-filter-done-items
2168 (concat "\\(?:" todos-done-string-start "\\|" 2200 (concat "\\(?:" todos-done-string-start "\\|"
2169 todos-date-string-start "\\)") 2201 todos-date-string-start "\\)")
@@ -2179,11 +2211,14 @@ priority has changed or its text was truncated or augmented, and
2179 (archive (string= (match-string 3 str) "(archive) ")) 2211 (archive (string= (match-string 3 str) "(archive) "))
2180 (filcat (match-string 4 str)) 2212 (filcat (match-string 4 str))
2181 (tpriority 1) 2213 (tpriority 1)
2214 (tpbuf (string-match "top" (buffer-name)))
2182 found) 2215 found)
2183 (setq str (replace-match "" nil nil str 4)) 2216 (setq str (replace-match "" nil nil str 4))
2184 (save-excursion 2217 (when tpbuf
2185 (while (search-backward filcat nil t) 2218 ;; Calculate priority of STR wrt its category.
2186 (setq tpriority (1+ tpriority)))) 2219 (save-excursion
2220 (while (search-backward filcat nil t)
2221 (setq tpriority (1+ tpriority)))))
2187 (setq file (if file 2222 (setq file (if file
2188 (concat todos-files-directory (substring file 0 -1) 2223 (concat todos-files-directory (substring file 0 -1)
2189 (if archive ".toda" ".todo")) 2224 (if archive ".toda" ".todo"))
@@ -2215,15 +2250,16 @@ priority has changed or its text was truncated or augmented, and
2215 (cons found (if (> (point) done) 2250 (cons found (if (> (point) done)
2216 'done 2251 'done
2217 (let ((cpriority 1)) 2252 (let ((cpriority 1))
2218 (save-excursion 2253 (when tpbuf
2219 ;; Not top item in category. 2254 (save-excursion
2220 (while (> (point) (1+ beg)) 2255 ;; Not top item in category.
2221 (let ((opoint (point))) 2256 (while (> (point) (1+ beg))
2222 (todos-backward-item) 2257 (let ((opoint (point)))
2223 ;; Can't move backward beyond 2258 (todos-backward-item)
2224 ;; first item in file. 2259 ;; Can't move backward beyond
2225 (unless (= (point) opoint) 2260 ;; first item in file.
2226 (setq cpriority (1+ cpriority)))))) 2261 (unless (= (point) opoint)
2262 (setq cpriority (1+ cpriority)))))))
2227 (if (and (= tpriority cpriority) 2263 (if (and (= tpriority cpriority)
2228 ;; Proper substring is not the same. 2264 ;; Proper substring is not the same.
2229 (string= (todos-item-string) 2265 (string= (todos-item-string)
@@ -2232,8 +2268,8 @@ priority has changed or its text was truncated or augmented, and
2232 'changed))))))))) 2268 'changed)))))))))
2233 (list found file cat))) 2269 (list found file cat)))
2234 2270
2235(defun todos-check-top-priorities () 2271(defun todos-check-filtered-items-file ()
2236 "Return a message saying whether top priorities file is up to date." 2272 "Check if filtered items file is up to date and a show suitable message."
2237 ;; (catch 'old 2273 ;; (catch 'old
2238 (let ((count 0)) 2274 (let ((count 0))
2239 (while (not (eobp)) 2275 (while (not (eobp))
@@ -2247,26 +2283,35 @@ priority has changed or its text was truncated or augmented, and
2247 ;; (throw 'old (message "The marked item is not up to date."))) 2283 ;; (throw 'old (message "The marked item is not up to date.")))
2248 (todos-forward-item)) 2284 (todos-forward-item))
2249 (if (zerop count) 2285 (if (zerop count)
2250 (message "Top priorities file is up to date.") 2286 (message "Filtered items file is up to date.")
2251 (message (concat "The highlighted item" (if (= count 1) " is " "s are ") 2287 (message (concat "The highlighted item" (if (= count 1) " is " "s are ")
2252 "not up to date." 2288 "not up to date."
2253 ;; "\nType <return> on item for details." 2289 ;; "\nType <return> on item for details."
2254 ))))) 2290 )))))
2255 2291
2256(defun todos-top-priorities-filename () 2292(defun todos-filter-items-filename ()
2257 "" 2293 "Return absolute file name for saving this Filtered Items buffer."
2258 (let ((bufname (buffer-name))) 2294 (let ((bufname (buffer-name)))
2259 (string-match "\"\\([^\"]+\\)\"" bufname) 2295 (string-match "\"\\([^\"]+\\)\"" bufname)
2260 (let* ((filename-str (substring bufname (match-beginning 1) (match-end 1))) 2296 (let* ((filename-str (substring bufname (match-beginning 1) (match-end 1)))
2261 (filename-base (replace-regexp-in-string ", " "-" filename-str))) 2297 (filename-base (replace-regexp-in-string ", " "-" filename-str))
2262 (concat todos-files-directory filename-base ".todt")))) 2298 (top-priorities (string-match "top priorities" bufname))
2263 2299 (diary-items (string-match "diary items" bufname))
2264(defun todos-save-top-priorities-buffer () 2300 (regexp-items (string-match "regexp items" bufname)))
2265 "" 2301 (when regexp-items
2266 (let ((filename (todos-top-priorities-filename))) 2302 (let ((prompt (concat "Enter a short identifying string"
2267 (if (file-exists-p filename) 2303 " to make this file name unique: ")))
2268 (save-buffer) 2304 (setq filename-base (concat filename-base "-" (read-string prompt)))))
2269 (write-region nil nil filename nil t nil t)))) 2305 (concat todos-files-directory filename-base
2306 (cond (top-priorities ".todt")
2307 (diary-items ".tody")
2308 (regexp-items ".todr"))))))
2309
2310(defun todos-save-filtered-items-buffer ()
2311 "Save current Filtered Items buffer to a file.
2312If the file already exists, overwrite it only on confirmation."
2313 (let ((filename (or (buffer-file-name) (todos-filter-items-filename))))
2314 (write-file filename t)))
2270 2315
2271;; --------------------------------------------------------------------------- 2316;; ---------------------------------------------------------------------------
2272;;; Sorting and display routines for Todos Categories mode. 2317;;; Sorting and display routines for Todos Categories mode.
@@ -3051,12 +3096,13 @@ file name and an initial category (defaulting to
3051of these, visits the file and displays the category. 3096of these, visits the file and displays the category.
3052 3097
3053The first invocation of this command on an existing Todos file 3098The first invocation of this command on an existing Todos file
3054interacts with the option `todos-show-first': if `table', show 3099interacts with the option `todos-show-first': if its value is
3055the table of categories in the file; if `top', show the 3100`first' (the default), show the first category in the file; if
3056corresponding top priorities file, if any; if `first' (the 3101its value is `table', show the table of categories in the file;
3057default value), show the first category in the file. Subsequent 3102if its value is one of `top', `diary' or `regexp', show the
3058invocations always show the file's current (i.e., last displayed) 3103corresponding saved top priorities, diary items, or regexp items
3059category. 3104file, if any. Subsequent invocations always show the file's
3105current (i.e., last displayed) category.
3060 3106
3061In Todos mode just the category's unfinished todo items are shown 3107In Todos mode just the category's unfinished todo items are shown
3062by default. The done items are hidden, but typing 3108by default. The done items are hidden, but typing
@@ -3090,18 +3136,35 @@ corresponding Todos file, displaying the corresponding category."
3090 (todos-add-file)))))) 3136 (todos-add-file))))))
3091 (unless (member file todos-visited) 3137 (unless (member file todos-visited)
3092 ;; Can't setq t-c-t-f here, otherwise wrong file shown when 3138 ;; Can't setq t-c-t-f here, otherwise wrong file shown when
3093 ;; called again from todos-display-categories. 3139 ;; todos-show is called from todos-display-categories.
3094 (let ((todos-current-todos-file file)) 3140 (let ((todos-current-todos-file file))
3095 (cond ((eq todos-show-first 'table) 3141 (cond ((eq todos-show-first 'table)
3096 (todos-display-categories)) 3142 (todos-display-categories))
3097 ((eq todos-show-first 'top) 3143 ((memq todos-show-first '(top diary regexp))
3098 (let* ((shortf (todos-short-file-name file)) 3144 (let* ((shortf (todos-short-file-name file))
3099 (tp-file (todos-absolute-file-name shortf 'top))) 3145 (fi-file (todos-absolute-file-name
3100 (if (file-exists-p tp-file) 3146 shortf todos-show-first)))
3147 (when (eq todos-show-first 'regexp)
3148 (let ((rxfiles (directory-files todos-files-directory t
3149 ".*\\.todr$" t)))
3150 (when (and rxfiles (> (length rxfiles) 1))
3151 (let ((rxf (mapcar 'todos-short-file-name rxfiles)))
3152 (setq fi-file (todos-absolute-file-name
3153 (completing-read
3154 "Choose a regexp items file: "
3155 rxf) 'regexp))))))
3156 (if (file-exists-p fi-file)
3101 (set-window-buffer 3157 (set-window-buffer
3102 (selected-window) 3158 (selected-window)
3103 (set-buffer (find-file-noselect tp-file 'nowarn))) 3159 (set-buffer (find-file-noselect fi-file 'nowarn)))
3104 (message "There is no top priorities file for %s" shortf) 3160 (message "There is no %s file for %s"
3161 (cond ((eq todos-show-first 'top)
3162 "top priorities")
3163 ((eq todos-show-first 'diary)
3164 "diary items")
3165 ((eq todos-show-first 'regexp)
3166 "regexp items"))
3167 shortf)
3105 (setq todos-show-first 'first))))))) 3168 (setq todos-show-first 'first)))))))
3106 (when (or (member file todos-visited) 3169 (when (or (member file todos-visited)
3107 (eq todos-show-first 'first)) 3170 (eq todos-show-first 'first))
@@ -3239,8 +3302,8 @@ displayed."
3239 "Save the current Todos file." 3302 "Save the current Todos file."
3240 (interactive) 3303 (interactive)
3241 (cond ((eq major-mode 'todos-filtered-items-mode) 3304 (cond ((eq major-mode 'todos-filtered-items-mode)
3242 (todos-check-top-priorities) 3305 (todos-check-filtered-items-file)
3243 (todos-save-top-priorities-buffer)) 3306 (todos-save-filtered-items-buffer))
3244 (t 3307 (t
3245 (save-buffer)))) 3308 (save-buffer))))
3246 3309
@@ -3869,13 +3932,9 @@ See `todos-set-top-priorities' for more details."
3869 (interactive) 3932 (interactive)
3870 (todos-set-top-priorities t)) 3933 (todos-set-top-priorities t))
3871 3934
3872(defun todos-top-priorities (&optional arg multifile) 3935(defun todos-top-priorities (&optional arg)
3873 "Display a list of top priority items from different categories. 3936 "Display a list of top priority items from different categories.
3874The categories are either a subset of those in the current Todos 3937The categories can be any of those in the current Todos file.
3875file, or else, with non-nil argument MULTIFILE, a subset of the
3876categories in the files listed in `todos-filter-files', or if
3877this nil, in the files chosen from a file selection dialog that
3878pops up in this case.
3879 3938
3880With numerical prefix ARG show at most ARG top priority items 3939With numerical prefix ARG show at most ARG top priority items
3881from each category. With `C-u' as prefix argument show the 3940from each category. With `C-u' as prefix argument show the
@@ -3884,37 +3943,13 @@ numbers of top priority items specified by category in
3884otherwise show `todos-show-priorities' items per category in the 3943otherwise show `todos-show-priorities' items per category in the
3885file(s). With no prefix argument, if a top priorities file for 3944file(s). With no prefix argument, if a top priorities file for
3886the current Todos file has previously been saved (see 3945the current Todos file has previously been saved (see
3887`todos-save-top-priorities-buffer'), visit this file; if there is 3946`todos-save-filtered-items-buffer'), visit this file; if there is
3888no such file, build the list as with prefix argument `C-u'. 3947no such file, build the list as with prefix argument `C-u'.
3889 3948
3890 The prefix ARG regulates how many top priorities from 3949 The prefix ARG regulates how many top priorities from
3891each category to show, as described above." 3950each category to show, as described above."
3892 (interactive "P") 3951 (interactive "P")
3893 (let* ((flist (if multifile 3952 (todos-filter-items 'top arg))
3894 (or todos-filter-files
3895 (progn (todos-multiple-filter-files)
3896 todos-multiple-filter-files))
3897 (list todos-current-todos-file)))
3898 (tp-file (if (equal flist 'quit)
3899 ;; Pressed `cancel' in file selection dialog.
3900 (keyboard-quit)
3901 (concat todos-files-directory
3902 (mapconcat 'identity
3903 (mapcar 'todos-short-file-name flist)
3904 "-")
3905 ".todt")))
3906 (tp-file-exists (file-exists-p tp-file))
3907 (buf todos-top-priorities-buffer))
3908 (cond ((and arg (natnump arg))
3909 (todos-filter-items (cons 'top arg) flist))
3910 ((and (not arg) tp-file-exists)
3911 (find-file tp-file)
3912 (todos-prefix-overlays)
3913 (todos-check-top-priorities))
3914 (t
3915 (todos-filter-items 'top flist)))
3916 (unless tp-file-exists
3917 (todos-filtered-buffer-name buf flist))))
3918 3953
3919(defun todos-top-priorities-multifile (&optional arg) 3954(defun todos-top-priorities-multifile (&optional arg)
3920 "Display a list of top priority items from different categories. 3955 "Display a list of top priority items from different categories.
@@ -3928,77 +3963,73 @@ show the numbers of top priority items specified in
3928`todos-priorities-rules', if this is non-nil; otherwise show 3963`todos-priorities-rules', if this is non-nil; otherwise show
3929`todos-show-priorities' items per category. With no prefix 3964`todos-show-priorities' items per category. With no prefix
3930argument, if a top priorities file for the chosen Todos files 3965argument, if a top priorities file for the chosen Todos files
3931exists (see `todos-save-top-priorities-buffer'), visit this file; 3966exists (see `todos-save-filtered-items-buffer'), visit this file;
3932if there is no such file, do the same as with prefix argument 3967if there is no such file, do the same as with prefix argument
3933`C-u'." 3968`C-u'."
3934 (interactive "P") 3969 (interactive "P")
3935 (todos-top-priorities arg t)) 3970 (todos-filter-items 'top arg t))
3936 3971
3937(defun todos-diary-items (&optional multifile) 3972(defun todos-diary-items (&optional arg)
3973 "Display a list of todo diary items from different categories.
3974The categories can be any of those in the current Todos file.
3975
3976Called with no prefix argument, if a diary items file for the
3977current Todos file has previously been saved (see
3978`todos-save-filtered-items-buffer'), visit this file; if there is
3979no such file, build the list of diary items. Called with a
3980prefix argument, build the list even if there is a saved file of
3981diary items."
3982 (interactive "P")
3983 (todos-filter-items 'diary arg))
3984
3985(defun todos-diary-items-multifile (&optional arg)
3938 "Display a list of todo diary items from different categories. 3986 "Display a list of todo diary items from different categories.
3939The categories are either a subset of those in the current Todos
3940file, or else, with non-nil argument MULTIFILE, a subset of the
3941categories in the files listed in `todos-filter-files', or if
3942this nil, in the files chosen from a file selection dialog that
3943pops up in this case."
3944 (interactive)
3945 (let ((flist (if multifile
3946 (or todos-filter-files
3947 (progn (todos-multiple-filter-files)
3948 todos-multiple-filter-files))
3949 (list todos-current-todos-file)))
3950 (buf todos-diary-items-buffer))
3951 (if (equal flist 'quit)
3952 ;; Pressed `cancel' in file selection dialog.
3953 (keyboard-quit)
3954 (todos-filter-items 'diary flist)
3955 (todos-filtered-buffer-name buf flist))))
3956
3957(defun todos-diary-items-multifile ()
3958 "Display a list of todo diary items from one or more Todos files.
3959The categories are a subset of the categories in the files listed 3987The categories are a subset of the categories in the files listed
3960in `todos-filter-files', or if this nil, in the files chosen from 3988in `todos-filter-files', or if this nil, in the files chosen from
3961a file selection dialog that pops up in this case." 3989a file selection dialog that pops up in this case.
3962 (interactive)
3963 (todos-diary-items t))
3964 3990
3965(defun todos-regexp-items (&optional multifile) 3991Called with no prefix argument, if a diary items file for the
3966 "Prompt for a regular expression and display items that match it. 3992chosen Todos files has previously been saved (see
3967The matches may be from different categories and with non-nil 3993`todos-save-filtered-items-buffer'), visit this file; if there is
3968option `todos-filter-done-items', can include not only todo items 3994no such file, build the list of diary items. Called with a
3969but also done items, including those in Archive files. 3995prefix argument, build the list even if there is a saved file of
3970 3996diary items."
3971The categories are either a subset of those in the current Todos 3997 (interactive "P")
3972file (and possibly in the corresponding Archive file), or else, 3998 (todos-filter-items 'diary arg t))
3973with non-nil argument MULTIFILE, a subset of the categories in 3999
3974the files listed in `todos-filter-files', or if this nil, in the 4000(defun todos-regexp-items (&optional arg)
3975files chosen from a file selection dialog that pops up in this
3976case (and possibly in the corresponding Archive files)."
3977 (interactive)
3978 (let ((flist (if multifile
3979 (or todos-filter-files
3980 (progn (todos-multiple-filter-files)
3981 todos-multiple-filter-files))
3982 (list todos-current-todos-file)))
3983 (buf todos-regexp-items-buffer))
3984 (if (equal flist 'quit)
3985 ;; Pressed `cancel' in file selection dialog.
3986 (keyboard-quit)
3987 (todos-filter-items 'regexp flist)
3988 (todos-filtered-buffer-name buf flist))))
3989
3990(defun todos-regexp-items-multifile ()
3991 "Prompt for a regular expression and display items that match it. 4001 "Prompt for a regular expression and display items that match it.
3992The matches may be from different categories and with non-nil 4002The matches can be from any categories in the current Todos file
3993option `todos-filter-done-items', can include not only todo items 4003and with non-nil option `todos-filter-done-items', can include
3994but also done items, including those in Archive files. 4004not only todo items but also done items, including those in
4005Archive files.
4006
4007Called with no prefix argument, if a regexp items file for the
4008current Todos file has previously been saved (see
4009`todos-save-filtered-items-buffer'), visit this file; if there is
4010no such file, build the list of regexp items. Called with a
4011prefix argument, build the list even if there is a saved file of
4012regexp items."
4013 (interactive "P")
4014 (todos-filter-items 'regexp arg))
3995 4015
3996The categories are a subset of the categories in the files listed 4016(defun todos-regexp-items-multifile (&optional arg)
3997in `todos-filter-files', or if this nil, in the files chosen from 4017 "Prompt for a regular expression and display items that match it.
3998a file selection dialog that pops up in this case (and possibly 4018The matches can be from any categories in the files listed in
3999in the corresponding Archive files)." 4019`todos-filter-files', or if this nil, in the files chosen from a
4000 (interactive) 4020file selection dialog that pops up in this case. With non-nil
4001 (todos-regexp-items t)) 4021option `todos-filter-done-items', the matches can include not
4022only todo items but also done items, including those in Archive
4023files.
4024
4025Called with no prefix argument, if a regexp items file for the
4026current Todos file has previously been saved (see
4027`todos-save-filtered-items-buffer'), visit this file; if there is
4028no such file, build the list of regexp items. Called with a
4029prefix argument, build the list even if there is a saved file of
4030regexp items."
4031 (interactive "P")
4032 (todos-filter-items 'regexp arg t))
4002 4033
4003;; --------------------------------------------------------------------------- 4034;; ---------------------------------------------------------------------------
4004;;; Editing Commands 4035;;; Editing Commands
@@ -6013,7 +6044,7 @@ the only category in the archive, the archive file is deleted."
6013;; --------------------------------------------------------------------------- 6044;; ---------------------------------------------------------------------------
6014(add-to-list 'auto-mode-alist '("\\.todo\\'" . todos-mode)) 6045(add-to-list 'auto-mode-alist '("\\.todo\\'" . todos-mode))
6015(add-to-list 'auto-mode-alist '("\\.toda\\'" . todos-archive-mode)) 6046(add-to-list 'auto-mode-alist '("\\.toda\\'" . todos-archive-mode))
6016(add-to-list 'auto-mode-alist '("\\.todt\\'" . todos-filtered-items-mode)) 6047(add-to-list 'auto-mode-alist '("\\.tod[tyr]\\'" . todos-filtered-items-mode))
6017 6048
6018;;; Addition to calendar.el 6049;;; Addition to calendar.el
6019;; FIXME: autoload when key-binding is defined in calendar.el 6050;; FIXME: autoload when key-binding is defined in calendar.el