1 \input texinfo.tex @c -*-texinfo-*-
3 @setfilename ../../info/todo-mode.info
4 @settitle Todo Mode User Manual
12 Copyright @copyright{} 2013-2017 Free Software Foundation, Inc.
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.3 or
17 any later version published by the Free Software Foundation; with no
18 Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
19 and with the Back-Cover Texts as in (a) below. A copy of the license
20 is included in the section entitled ``GNU Free Documentation License''.
22 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
23 modify this GNU manual.''
27 @dircategory Emacs misc features
29 * Todo Mode: (todo-mode). Make and maintain todo lists.
33 @title Todo Mode User Manual
34 @subtitle Facilities for making and maintaining todo lists.
36 @author Stephen Berman
39 @vskip 0pt plus 1filll
48 @top Todo Mode User Manual
50 This manual describes the version of Todo mode first appearing in
58 * Todo Mode Entry Points::
59 * Key Binding Conventions::
60 * Navigation:: Moving within and between categories.
61 * Editing:: Adding, deleting and changing todo
62 files, categories and items.
63 * Todo Archives:: Files of done todo items.
64 * Marked Items:: Acting on multiple items simultaneously.
65 * Todo Categories Mode:: Table of categories and item counts.
66 * Searching for Items::
67 * Todo Filtered Items Mode:: Making virtual categories of items from
68 different categories and files.
69 * Todo Display Features::
70 * Printing Todo Buffers::
71 * Legacy Todo Mode Files:: Converting old-style todo files.
73 * GNU Free Documentation License::
76 --- The Detailed Node Listing ---
80 * Levels of Organization::
81 * Todo Items as Diary Entries::
91 * Inserting New Items::
92 * Editing Item Headers and Text::
93 * Relocating and Removing Items::
95 Relocating and Removing Items
97 * Reprioritizing Items::
98 * Moving and Deleting Items::
103 * Creating and Visiting Archives::
104 * Todo Archive Mode::
108 * Table of Item Counts::
109 * Reordering Categories::
111 Todo Filtered Items Mode
114 * Todo Filtered Items Mode Commands::
115 * Files of Filtered Items::
117 Todo Display Features
121 * Other Display Commands and Options::
125 @node Overview, Todo Mode Entry Points, Top, Top
128 The Todo mode package provides facilities for making and maintaining
129 todo lists. A todo list is a list of todo items---things to do (in the
130 widest sense)---arranged in order of priority, with the highest priority
131 item at the top of the list and the lowest priority item at the bottom.
133 This manual describes the Todo mode user interface. Todo mode comprises
134 a large number of commands and user options for creating, displaying,
135 navigating and editing todo lists, distributed across five major modes.
136 The principle major mode is Todo mode; the other four (Todo Edit mode,
137 Todo Archive mode, Todo Categories mode, and Todo Filtered Items mode)
138 are subsidiary to and accessible from Todo mode.
140 This version of Todo mode greatly expands on, and in significant ways
141 differs from, the original version; for details and consequences of the
142 most important differences, @ref{Legacy Todo Mode Files}.
145 * Levels of Organization::
146 * Todo Items as Diary Entries::
149 @node Levels of Organization, Todo Items as Diary Entries, , Overview
150 @section Levels of Organization
152 In Todo mode each todo list is identified with a named category, so you
153 can group together thematically related todo items. Each category is
154 stored in a file, which thus provides a further level of organization.
155 You can create as many todo files, and in each as many categories, as
158 All todo files reside in a single directory, whose location is specified
159 by the user option @code{todo-directory}. This directory may also
160 contain other types of Todo files, which are discussed later
161 (@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}).
162 @c Emacs recognizes Todo files by their extension, so when you visit
163 @c the files the buffer is in the appropriate mode and the current
164 @c category is correctly displayed.
165 When you use a Todo mode command to create a todo file, the extension
166 @samp{.todo} is automatically added to the base name you choose (as a
167 rule, this name is also used for the other types of Todo files, which
168 have their own extensions). As a user, you only have to deal with the
169 base name of a Todo file.
171 When you create a new todo file, you must also add at least one category
172 to it, and each todo item belongs to a category. It is not possible to
173 have an uncategorized todo list, but you can always make a catch-all
174 category with a generic name like ``Todo'', which is in fact the default
175 name assigned to the first category when you create a new todo file, if
176 you don't provide a different name; you can change the default by
177 customizing @code{todo-initial-category}.
179 The most basic level of organization is the todo item itself, since it
180 contains the information about what you want to do. As detailed in
181 subsequent sections of this manual, most Todo mode commands and user
182 options concern ways of classifying and deploying this information by
183 associating various kinds of metadata with it, e.g., the category it
184 belongs to, its priority, whether it is to be included in the Emacs
185 diary, date and time stamps, whether it is done or still to do.
187 @node Todo Items as Diary Entries, , Levels of Organization, Overview
188 @section Todo Items as Diary Entries
190 You can have todo items show up in the Emacs Fancy Diary display by
191 including the todo file in your diary file (@pxref{Fancy Diary
192 Display,,, emacs}). This effectively augments the Emacs diary with
193 categorized diary entries. All items in an included todo file will
194 appear in the Fancy Diary display except for those that are marked
195 with @code{todo-nondiary-marker}. You can add or omit this marking
196 upon creating a new todo item, or you can do so by editing an existing
197 item, see @ref{Inserting New Items} and @ref{Editing Item Headers and
200 To ensure the proper display of todo items in the Fancy Diary display,
201 they must have the format of diary entries, i.e., they have to begin
202 with a date string recognized by the Emacs diary,@footnote{Two types of
203 dates recognized by the Emacs diary are not supported in the current
204 Todo mode implementation: sexp diary entries and date strings in which
205 the year is omitted (however, the latter type is equivalent to using
206 @samp{*} for an arbitrary year, which Todo mode does support).} and if
207 they are longer than one line, all lines but the first must begin with
208 white space. Todo mode ensures that these requirements are satisfied
209 (@pxref{Other Display Commands and Options}).
211 The Fancy Diary display is also Todo mode aware: if it contains an item
212 from a Todo mode file, clicking or typing @key{RET} on this item will
213 switch to the buffer visiting that file and properly display the item's
214 category, with point on the item.
216 @node Todo Mode Entry Points, Key Binding Conventions, Overview, Top
217 @chapter Todo Mode Entry Points
219 To initialize your first todo file, invoke the command @code{todo-show}.
220 This prompts you for a file name (defaulting to the value of
221 @code{todo-initial-file}), prompts you for the name of the first
222 category (defaulting to the value of @code{todo-initial-category}),
223 creates and visits the file and displays the category in Todo mode, and
224 then prompts you to enter the first item. If you choose not to enter an
225 item now, simply type @kbd{C-g}, which leaves the category empty but
226 otherwise well-formed. If you prefer not to be prompted to enter an
227 item on adding a new category, disable the option
228 @code{todo-add-item-if-new-category}.
230 Once at least one todo file exists, invoking @code{todo-show} enters
231 Todo mode. Invoked with a prefix argument, the command prompts for
232 which todo file to visit. Otherwise, the first invocation of this
233 command after loading the Todo mode package visits the default todo file
234 (option @code{todo-default-todo-file}) and shows its first category.
235 (You can get a different display with the first invocation of
236 @code{todo-show} by customizing the option @code{todo-show-first};
237 @pxref{Todo Categories Mode} and @ref{Files of Filtered Items}.)
239 If you leave Todo mode and later invoke @code{todo-show} to re-enter it,
240 by default this returns you to the current (i.e., last displayed)
241 category of the current todo file, which is the one in the most recently
242 selected and still live buffer visiting a todo file. If you disable the
243 option @code{todo-show-current-file}, then non-initial invocations of
244 @code{todo-show} always return to the first or current category of the
247 If you want to enter Todo mode and go directly to a specific category
248 instead the first or current category in the current or default todo
249 file, use the command @code{todo-jump-to-category}; @ref{Navigation},
250 for details. You can also enter Todo mode by invoking the command
251 @code{todo-insert-item}; @ref{Inserting New Items}, for details.
253 The most convenient way to use these commands to enter Todo mode is to
254 define global key bindings for them in your init file. Good choices
255 are @kbd{C-c t} for @code{todo-show}, @kbd{C-c j} for
256 @code{todo-jump-to-category} and @kbd{C-c i} for
257 @code{todo-insert-item}, since these commands are bound to @kbd{t},
258 @kbd{j} and @kbd{i}, respectively, in Todo mode.
260 @c You can also visit a Todo file via @code{find-file} or Dired, like any
261 @c other file, and since Emacs recognizes it, the buffer will automatically
262 @c be in the appropriate Todo mode. Moreover, as long as the command you
263 @c use to visit the file is listed in the option
264 @c @code{todo-visit-files-commands} (which by default contains
265 @c @code{find-file} and @code{dired-find-file}), it will also correctly
266 @c display the file's first category on first visiting the file (otherwise
267 @c you have to use one of the commands for navigating between categories in
268 @c order to get a proper display).
270 You can leave Todo mode by typing @kbd{q} (@code{todo-quit}), which
271 buries the current todo file buffer. Doing this also saves any changes
272 you have made to the file, and leaves both the file and the category
273 that was displayed on quitting current for subsequent Todo mode commands
274 (unless the buffer made current by quitting is visiting another file and
275 category in Todo mode, in which case the latter become current for Todo
278 @node Key Binding Conventions, Navigation, Todo Mode Entry Points, Top
279 @chapter Key Binding Conventions
281 For Todo mode commands to function properly, it is essential to maintain
282 the correct format at all three levels of organization---item, category,
283 and file. Todo mode tries to minimize the risk of format corruption by
284 hiding certain parts of the format from the user, making the buffer
285 read-only and suppressing the self-insertion keys. Consequently, it is
286 normally impossible to make changes to your todo files without
287 explicitly invoking Todo mode commands.
289 A beneficial side effect of this restrictiveness is that you can invoke
290 almost all Todo commands by typing ordinary printing characters, either
291 singly or in specified sequences, without using modifier keys, except
292 for the shift key for capitalization and the raw prefix argument
293 @kbd{C-u}; numeric prefix arguments can be entered just by typing a
296 The predefined key bindings in Todo are more or less mnemonic. As a
297 rule, key sequences beginning with @kbd{C} (capital @samp{C}, not the
298 control key) are bound to commands applying to categories, sequences
299 beginning with @kbd{F} apply to (non-archive) file-level commands, and
300 those beginning with @kbd{A} apply to archives (a special type of Todo
301 file; @ref{Todo Archive Mode}). Todo commands applying to items,
302 which constitute the majority, are bound to lower case key sequences.
304 @node Navigation, Editing, Key Binding Conventions, Top
307 The navigation commands are for making another todo file, category, or
308 item the current one by moving point to it.@footnote{Many editing
309 commands can also do this by side effect, but since that is not their
310 main function, they are not included in this section.} Since these
311 commands are likely to be used frequently and repetitively, it is
312 convenient for their key bindings to be single lower case keys, even for
313 navigation commands applying to categories and files.
315 Two of the navigation commands were already mentioned in @ref{Todo
321 Display another todo file in the selected window (@code{todo-show}).
322 When you invoke this command in Todo mode, it prompts for a file name,
323 which you can choose via minibuffer completion (like invoking
324 @code{todo-show} with a prefix argument outside of Todo mode). If a
325 buffer is already visiting that file, it displays its current category;
326 if invoking @kbd{t} opens the file, it display its first category (by
327 default; see the option @code{todo-show-first} for other possibilities).
330 Display another todo category in the selected window
331 (@code{todo-jump-to-category}). When you invoke this command, it
332 prompts for a category name, which you can choose via minibuffer
333 completion. The candidates for completion include the categories in the
334 current todo file as well as those in the files listed in the option
335 @code{todo-category-completions-files}. If you type @key{RET} without
336 choosing a category, the current category of the current todo file is
337 automatically selected (this can be a useful shortcut when you invoke
338 @code{todo-jump-to-category} outside of Todo mode). If you type the
339 name of a non-existing category, you can add this to the file as a new
340 category and jump to it. If you invoke this command with a prefix
341 argument, it first you prompts for which todo file to jump to (which you
342 can also choose with minibuffer completion) and then for which category
343 from that file; in this case, completion is only against the categories
344 in the selected file.
347 It is also convenient to navigate back and forth sequentially between
348 the categories of a single todo file. The categories of a todo file are
349 numbered consecutively starting with @samp{1}.@footnote{A category's
350 number is automatically assigned when the category is created: the
351 category is appended to the end of the file, so its number is simply the
352 highest until another category is added. There is no command in Todo
353 mode to reorder the numbering of the categories in a todo file, but this
354 is possible from the file's table of categories; @ref{Todo Categories
355 Mode}.} The current category's number and name appear in the mode line.
360 Move point to the first item of the category numerically directly
361 following the current category (@code{todo-forward-category}).
364 Move point to the first item of the category numerically directly
365 preceding the current category (@code{todo-backward-category}).
368 With @kbd{f} and @kbd{b} you can cycle through the categories, so for example,
369 if the last category is current and you type @kbd{f}, then the first
370 category becomes current.
372 You can also navigate between the items in the current category:
377 Move point down to the next item below the current one (i.e., to the
378 item with the next lower priority) (@code{todo-next-item}).
381 Move point up to the item directly above the current one (i.e., to the
382 item with the next higher priority) (@code{todo-previous-item}).
385 These commands also accept a positive numeric prefix argument; e.g.,
386 typing @kbd{5 n} or @kbd{5 p} navigates in one step to the item five items lower
387 or higher than the current one.
389 Navigation to other types of Todo files is discussed in the relevant
392 @node Editing, Todo Archives, Navigation, Top
395 Editing in Todo mode means making structural or textual changes at one
396 of the levels of organization (file, category, or item). Structural
397 editing includes adding, relocating and removing units of information
398 at a level; textual editing includes renaming files or categories and
399 changing an item's content or date/time stamp, or adding certain kinds
400 of marks or tags to items. Todo mode provides commands, detailed in
401 the following sections, which enable you to quickly and safely make
402 changes to your todo lists, without having to worry about preserving
405 To save changes you make to the current todo file,
406 type @kbd{s} (@code{todo-save}). Changes are also saved on quitting
407 Todo mode with @kbd{q}.
415 @node File Editing, Category Editing, , Editing
416 @section File Editing and Todo Edit Mode
418 There are four file-level editing commands:
423 Add a new todo file (@code{todo-add-file}). This command prompts for
424 a name and creates the file in @code{todo-directory}, adding the
425 @samp{.todo} extension (so you should not include the extension in the
426 name you enter). The command also prompts for the file's first
427 category and, if option @code{todo-add-item-if-new-category} is
428 enabled (the default), for that category's first item.
431 Rename the current todo file (@code{todo-rename-file}). If called with
432 a prefix argument, prompt for a todo file and rename it. If the todo
433 file has an archive (@pxref{Todo Archive Mode}) or there are
434 corresponding filtered items files (@pxref{Todo Filtered Items Mode}),
435 this command renames these accordingly. If there are live buffers
436 visiting any of these files, the command also renames them accordingly.
439 Delete the current todo file (@code{todo-delete-file}).@footnote{The key
440 binding of this command is mnemonic for ``kill'' to parallel the binding
441 @kbd{k} for item deletion, since @kbd{d} is bound to another item
442 editing command (@pxref{Done Items}).} If the todo file has an archive
443 (@pxref{Todo Archive Mode}), prompt for whether to delete that as well.
444 This command also kills the buffers visiting the deleted files.
447 This command (@code{todo-edit-file}) changes the buffer's major mode to
448 Todo Edit mode. In this mode the entire file is visible, the buffer is
449 writable and you can use the self-insertion keys and standard Emacs
450 editing commands to make changes. To return to Todo mode, type @kbd{C-x
451 C-q} (@code{todo-edit-quit}).
453 The command @kbd{F e} is not intended for normal editing of items and
454 categories, as it circumvents the restrictions that Todo imposes to
455 protect against file format corruption (i.e., all categories, not just
456 the current one, and all internal formatting are exposed and editable).
457 It is provided primarily as a convenience for two types of use cases
458 that are likely to arise infrequently. One is to be able to use
459 standard Emacs commands like @code{query-replace} to replace a piece of
460 text that occurs in different categories throughout the file. The other
461 use case is to recover from a mistake, such as accidentally deleting an
462 item, since this cannot be undone in Todo mode.
464 Using @kbd{C-x C-q} to quit Todo Edit mode provides a measure of
465 safety, since it runs a file format check, signaling an error if the
466 format has become invalid. However, this check cannot tell if the
467 number of items or categories changed, which could result in the file
468 containing inconsistent information (see the cautionary note in
469 @ref{Reordering Categories}, for more details). Invoking @kbd{F e}
470 displays a warning to this effect.
473 @node Category Editing, Item Editing, File Editing, Editing
474 @section Category Editing
476 The following commands are available for editing specifically at the
477 category level (for two other category-editing commands, which are
478 extensions of item commands, @pxref{Editing Item Headers and Text}):
483 Add a new category to the current todo file and make that category
484 current (@code{todo-add-category}). If called with a prefix argument,
485 prompt for a file name and add the new category to that file. This
486 command is similar to using @kbd{j}, but it only accepts category names
487 that are not the name of an existing category in the file.
490 Rename the current category (@code{todo-rename-category}). If this
491 category's file has an archive (@pxref{Todo Archive Mode}) with a
492 corresponding category, rename the category there as well.
495 Move the current category (with all its items) to another todo file
496 (@code{todo-move-category}). If this category's file has an archive
497 (@pxref{Todo Archive Mode}) with a corresponding category, this command
498 also moves that category to the archive file corresponding to the moved
499 to todo file; if there is no such archive file, the command creates it
500 and adds the category.
503 Delete the current category (@code{todo-delete-category}).@footnote{This
504 binding is mnemonic for ``kill'' to parallel the binding @kbd{k} for
505 item deletion, since @kbd{d} is bound to another item editing command
506 (@pxref{Done Items}).} To delete a category that contains items, you
507 have to confirm your intent; if the category is empty, deletion is
511 Merge the items of one category into another category, delete the first
512 category and make the second category current
513 (@code{todo-merge-category}). If both the first and second categories
514 also have archived items (@pxref{Todo Archive Mode}), merge the former
515 to the latter. If only the first category has archived items, rename
516 the archive category to the merged to category. Minibuffer completion
517 of the name of the category merged to works as with the navigation
518 command @kbd{j}, and as with that command, passing a prefix argument,
519 i.e., typing @kbd{C-u C g}, prompts for a file and confines merging to a
520 category in that file.
523 @node Item Editing, , Category Editing, Editing
524 @section Item Editing
526 Todo mode provides commands for adding new items as well as textually
527 changing, deleting and relocating existing items. The commands and
528 associated options for adding and editing items, in particular, offer
529 you a lot of flexibility to fine-tune these operations to your needs.
532 * Inserting New Items::
533 * Editing Item Headers and Text::
534 * Relocating and Removing Items::
537 @node Inserting New Items, Editing Item Headers and Text, , Item Editing
538 @subsection Inserting New Items
540 To add a new todo item to a category, type @kbd{i}, which is bound to
541 the command @code{todo-insert-item}.
546 This command is the entry point for inserting new items into a
547 category (@code{todo-insert-item}). It prompts for additional keys
548 until reaching a complete key sequence, which specifies the insertion
549 parameters you wish to apply (see below). It then prompts for the
550 text of the item, which you enter in the minibuffer.@footnote{There
551 are two insertion parameters that override prompting for and manually
552 entering the new item's text, see below.} Called with one prefix
553 argument, it also prompts for a category, and called with two prefix
554 arguments, it prompts for both a file and a category from that file,
555 and inserts the item accordingly; category name completion works as
556 with the navigation command @kbd{j}. Finally, it inserts the item
557 into the current or selected category of the current or selected todo
558 file at the position in the list corresponding to the priority you
559 choose, which also depends on the insertion parameters.
563 The name of this command reflects the fact that you can insert a new
564 item into the category at any position, giving each new item any
565 priority in the list, whereas speaking of adding an item to a category
566 suggests appending it to the top or bottom.
568 In addition to its file and category, each newly inserted todo item
569 has a priority in the category and begins with a header string, which
570 includes at least the current date in the same format used by
571 @code{diary-insert-entry} (@pxref{Date Formats,,, emacs}). You can
572 specify the priority and the content of the header string in two ways.
573 First, you can set the following item insertion options, which apply
574 on every invocation of @code{todo-insert-item}.
579 @code{todo-default-priority} is for automatically assigning a new item
580 the highest or lowest priority in the category, if you do not
581 explicitly assign it a priority on invoking @code{todo-insert-item}.
582 By default, such new items are given highest priority, i.e., inserted
583 at the top of the list.
586 @code{todo-always-add-time-string} is for including or omitting the
587 current time in the new item's header. By default, this time string
591 @code{todo-include-in-diary} is for specifying whether the item
592 appears in the Fancy Diary display (when the todo file is included in
593 the Emacs diary file) by adding or omitting
594 @code{todo-nondiary-marker}. By default, new todo items are so
595 marked, thus excluded from the diary.
598 @code{todo-diary-nonmarking} is for adding or omitting
599 @code{diary-nonmarking-symbol} to items displayed in the diary, to
600 control whether they are marked in the calendar (@pxref{Format of
601 Diary File,,, emacs}). By default, todo items that are diary entries
602 lack this symbol, thus are marked in the calendar.
605 Beside setting these options, for more flexibility you can also pass
606 certain parameters on each invocation of @code{todo-insert-item}.
607 These parameters concern not only the new item's priority and header,
608 but also its textual content. You pass these parameters by typing a
609 sequence of one or more keys after the initial @kbd{i}.
611 Here is a list of the item insertion parameters together with their
612 mnemonically associated keys@footnote{The non-mnemonic choice of
613 @kbd{i} for the parameter @samp{default} is motivated by the
614 convenience of repeating the @kbd{i} used to invoke
615 @code{todo-insert-item}.} and descriptions of their effect in
616 @code{todo-insert-item}:
621 @samp{default} (@kbd{i}): Prompt for the new item's priority
622 (a number between 1 and one more than the number of items already in
623 the category) and add a header string conforming to the values of the
626 @samp{copy} (@kbd{p}): Make an exact copy of the item at point,
627 including its header string, and prompt for its priority. (This is
628 useful for quickly making a new todo item whose text or header you
629 want to differ only partly from that of an existing item: after
630 inserting the copy, you can quickly edit it as needed by using
631 operations described in the next section.)
634 @samp{diary} (@kbd{y}): Override the option
635 @code{todo-include-in-diary}; that is, add @code{todo-nondiary-marker}
636 if the option is non-@code{nil}, omit this marker if the option is @code{nil}.
638 @samp{nonmarking} (@kbd{k}): Override the option
639 @code{todo-diary-nonmarking}; that is, add
640 @code{diary-nonmarking-symbol} if the option is non-@code{nil}, omit this
641 symbol if the option is @code{nil}. Since this symbol only applies to diary
642 items, the new item is automatically marked as such, i.e., lacks
643 @code{todo-nondiary-marker}.
646 @samp{calendar} (@kbd{c}): Pop up the Emacs calendar and click a date
647 in it to use that date in the new todo item's header.
649 @samp{date} (@kbd{d}): Prompt for entering in the minibuffer
650 the year, month (with completion) and day number components of the
653 @samp{dayname} (@kbd{n}): Prompt for entering in the minibuffer
654 a weekday name as the date header instead of a year-month-day string.
657 @samp{time} (@kbd{t}): Prompt for entering a time string in
658 the minibuffer instead of automatically inserting the current time;
659 however, typing @key{RET} at the prompt enters the current time if
660 @code{todo-always-add-time-string} is non-@code{nil}, otherwise it enters the
661 empty string (i.e., no time string).
664 @samp{here} (@kbd{h}): Insert the new item in the position of
665 the item at point, pushing that and all lower items in the category
666 down, i.e., lowering their priority, by one.
668 @samp{region} (@kbd{r}): Use the text of the selected region as the
669 text of the new item, and insert this in accordance with the item
670 insertion options and other parameters passed. If the option
671 @code{todo-use-only-highlighted-region} is non-@code{nil}, then use the
672 region only when it is highlighted; otherwise, use the region
673 regardless of highlighting.
676 Note that the parameters are divided into five numbered groups; within
677 a group, the parameters are mutually exclusive. Hence, to build a
678 complete insertion operation, you select at most one parameter from at
679 least one of these groups, by typing the corresponding key. If you
680 want to apply more than one parameter, you must type the corresponding
681 keys in the order of the numbered groups, subject to the following
684 The keys of groups 2-4 are continuation keys, that is, each can be
685 followed by a key from a following group. If you want to finish the
686 sequence with a continuation key, you must double the final key. For
687 example, @kbd{i y} is not a complete key sequence; rather, you must
690 By contrast, the keys of groups 1 and 5 are final keys; for example,
691 @kbd{i i} and @kbd{i h} are complete sequences. The reason for making
692 two separate groups of the final keys is that the parameters
693 @samp{default} and @samp{copy} cannot be combined with any other
694 parameters, while @samp{here} and @samp{region} can be combined with
695 any of the parameters from groups 2-4.
697 To aid you in building item insertion key sequences, when you type an
698 insertion key, this displays a prompt in the echo area showing pairs
699 of the remaining possible keys and their associated parameters,
700 grouped and ordered in accordance with the above list. The initial
701 prompt, after typing @kbd{i} to invoke @code{todo-insert-item}, looks
705 Press a key (so far @kbd{i}): @{ i=>default p=>copy @} @{ y=>diary k=>nonmarking @} @{ c=>calendar d=>date n=>dayname @} t=>time @{ h=>here r=>region @}
708 @noindent If you now type @kbd{y}, the prompt changes to this:
711 Press a key (so far @kbd{i y}): y=>diary:GO! @{ c=>calendar d=>date n=>dayname @} t=>time @{ h=>here r=>region @}
714 @noindent Notice that the pair @samp{k=>nonmarking} is now absent, since it
715 belongs to the same group as the selected pair @samp{y=>diary}, hence
716 is no longer available for this sequence. Since @kbd{y} is a
717 continuation key, it is still available, but now the string
718 @samp{:GO!} is appended to the pair to remind you that pressing this
719 key again will complete the sequence.
723 @c Here are some examples of item insertion command key sequences:
728 @c @kbd{i h} inserts a new item at the position of the item at point (pushing
729 @c the latter down) with a header containing the current date and,
730 @c depending on the values of the mentioned options, possibly the current
731 @c time and diary-related markings.
733 @c @kbd{i y h} does the same as the preceding command, except that
734 @c @code{todo-nondiary-marker} is added if @code{todo-include-in-diary} is
735 @c non-@code{nil} and omitted if that option is @code{nil}; that is,
736 @c the diary key @kbd{y} @c overrides the setting of this option.
738 @c @kbd{i y t h} does the same as the preceding command, except that it
739 @c prompts for a time string instead of automatically inserting the
740 @c current time; however, typing @key{RET} at the prompt returns the
741 @c current time if @code{todo-always-add-time-string} is non-@code{nil},
742 @c otherwise the empty string (i.e., no time string).
744 @c @kbd{i y t t} does the same as the preceding command, except that it
745 @c prompts for the item's priority and inserts it accordingly.
749 An alternative to the key sequence @kbd{i c c} for choosing the item's
750 date from the calendar is also available: when point is already on a
751 date in the calendar, typing @kbd{i t}
752 (@code{todo-insert-item-from-calendar}) prompts for a new item and its
753 priority and inserts it in the current category. This command, like
754 @code{todo-insert-item}, also accepts one or two prefix arguments for
755 choosing the category via minibuffer completion. Note, however, that
756 the key sequence @kbd{i t} is not defined in Todo mode but in the
757 Calendar mode keymap. It is a convenient shortcut if you happen to be
758 using the calendar when you decide to make a new todo item. (Contrast
759 this with passing the @samp{calendar} parameter, which pops open the
760 calendar after you have entered the item's text, and then you can
761 choose a date from the calendar.)
764 @node Editing Item Headers and Text, Relocating and Removing Items, Inserting New Items, Item Editing
765 @subsection Editing Item Headers and Text
767 To make changes to an existing item's content or header, type @kbd{e},
768 which is bound to the command @code{todo-edit-item}.
773 This command is the entry point for textually editing existing items
774 in a category (@code{todo-edit-item}). It prompts for additional keys
775 until reaching a complete key sequence, which specifies the editing
776 parameters you wish to apply (see below), and then executes the
777 editing operation accordingly.
780 Here is a list of the item editing parameters together with their
781 mnemonically associated keys and descriptions of their effect in
782 @code{todo-edit-item}. The list is divided into three groups, for
783 reasons explained below.
788 @samp{edit} (@kbd{e}): Edit the text of the current item in the
789 minibuffer; the item's header is omitted.
791 @samp{header} (@kbd{h}): Edit the text and header of the current item
794 @samp{multiline} (@kbd{m}): Edit the text of the current item in a
795 special buffer in Todo Edit mode. After editing, type @kbd{C-x C-q}
796 to return to Todo mode.@footnote{This runs a format check to ensure
797 the item is well-formed. However, unlike the command @kbd{F e}
798 (@pxref{File Editing}), @kbd{e m} does not expose you to the risk of
799 putting the file in an inconsistent state, since it puts only the
800 current item in Todo Edit mode.}
802 @samp{diary} (@kbd{y}): Change the current item's diary inclusion
803 status by adding @code{todo-nondiary-marker} if the item lacks this,
804 or by removing it if present.
806 @samp{nonmarking} (@kbd{k}): Change the current item's calendar
807 marking status by adding @code{diary-nonmarking-symbol} if the item
808 lacks this, or by removing it if present. Since this symbol only
809 applies to diary items, the item is automatically marked as such,
810 i.e., if @code{todo-nondiary-marker} is present, it is removed.
812 @samp{date} (@kbd{d}): Prompt for a final key from the second group
813 of item editing parameters to edit the current item's date string.
815 @samp{time} (@kbd{t}): Edit the current item's time string, if
816 present; otherwise, add one. Typing @key{RET} at the prompt enters
817 the current time if @code{todo-always-add-time-string} is non-@code{nil},
818 otherwise it enters the empty string (i.e., no time string).
822 Editing the text of a lengthy item in the minibuffer can be
823 inconvenient; therefore, if you type @kbd{e e} or @kbd{e h} on an item
824 whose text contains more than one logical line, the effect is the same
825 as if you had typed @kbd{e m}, that is, you switch a special buffer in
828 When you pass any of the parameters of the preceding group, except for
829 the @samp{date} parameter, this completes the item editing invocation
830 begun by typing @kbd{e}. Pressing @kbd{d} to pass the @samp{date}
831 parameter, however, prompts you with the following parameters and
832 their associated keys, and pressing any of these completes the
838 @samp{full} (@kbd{f}): Successively prompt for editing the year, month
839 (with completion) and day number parts of the current item's date
840 string, and, if the option @code{todo-always-add-time-string} is
841 non-@code{nil}, also for editing its time string.
843 @samp{calendar} (@kbd{c}): This pops up the Emacs calendar, and after
844 you type @key{RET} on a date in the calendar makes that date the
847 @samp{today} (@kbd{a}): Make the item's date today's date.
849 @samp{dayname} (@kbd{n}): Prompt for a weekday name (with completion)
850 and make it the item's date header. Note that this replaces an
851 existing date string, it does not add the day name to the date string.
853 @samp{year} (@kbd{y}): Edit just the year component of the current
856 @samp{month} (@kbd{m}): Edit just the month component of the current
857 item's date string (with completion).
859 @samp{daynum} (@kbd{d}): Edit just the day number component of the
860 current item's date string.
864 With the latter three parameters you can add a positive or negative
865 numeric prefix argument to the invocation: this increments or
866 decrements the selected date component by the given number and
867 automatically adjusts the other date components if necessary. For
868 example, if the item's date string is ``January 1, 2013'', then typing
869 @kbd{- 3 e d d} results in ``December 29, 2012''.
871 The first two groups of parameters apply only to todo items that are
872 not marked as done (@pxref{Done Items}); the two parameters of the
873 third group, in contrast, apply only to done todo items. You cannot
874 edit the text of such items, but you can edit or delete the comment
875 you may have added on marking the item as done (@pxref{Done Items,
876 @code{todo-item-done}},), or retroactively add a comment, by passing
877 either of these parameters.
882 @samp{add/edit comment} (@kbd{c}): Edit the current done item's
883 comment, if it has one; otherwise, prompt for and add a comment.
885 @samp{delete comment} (@kbd{d}): Delete the current done item's
886 comment, if it has one.
889 The command @code{todo-edit-item} is sensitive to the distinction
890 between not done and done todo items. If you type @kbd{e} when point
891 is on a done item, this displays the following prompt in the echo
895 Press a key (so far @kbd{e}): c=>add/edit comment d=>delete comment
899 Only by typing @kbd{c} or @kbd{d} in response to this prompt can you
900 complete the invocation. In contrast, if you type @kbd{e} when point
901 is on a non-done todo item, this displays the following prompt in the
902 echo area, and you can continue or complete the invocation only by
903 typing one of the listed keys:
906 Press a key (so far @kbd{e}): e=>edit h=>header m=>multiline y=>diary k=>nonmarking d=>date t=>time
909 As noted above, passing the @samp{date} parameter does not complete
910 the invocation of @code{todo-edit-item}; rather, it displays the
911 following prompt, and typing any of these keys does complete the
915 Press a key (so far @kbd{e d}): f=>full c=>calendar a=>today n=>dayname y=>year m=>month d=>daynum
918 In addition to the item-level invocations @kbd{e y}, to change the
919 current item's diary inclusion status, and @kbd{e k}, to change the
920 current item's calendar marking status, Todo mode also has two related
921 category-level commands:
927 Add @code{todo-nondiary-marker} and @code{diary-nonmarking-symbol},
928 respectively, to all todo items in the current category; if invoked with
929 a prefix argument, these markings are removed from all items in the
934 Like @kbd{e k}, @kbd{C e k} automatically removes @code{todo-nondiary-marker}
935 from all items it is present on, since only diary items can bear
936 @code{diary-nonmarking-symbol}.
938 Since categories often contain a mix of items marked for diary
939 inclusion and exclusion, and of the former, a mix of those to be
940 marked and those not to be marked in the calendar, it is more useful
941 for these category-level commands, unlike the item-level commands, not
942 to be toggles, but to have the same effect on all items in the
943 category, and take a prefix argument to reverse the effect. (If you
944 really want to toggle the diary-inclusion and calendar-marking status
945 of all items in the category, you can do this by marking all the items
946 and then invoking @kbd{e y} or @kbd{e k}, @pxref{Marked Items}).
948 @node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing
949 @subsection Relocating and Removing Items
951 In addition to inserting a new todo item and changing the text or header
952 of an existing item, you can also move an item to another category
953 (i.e., recategorize it), change its priority within its category, delete
954 it from the category and file, or mark it as a ``done'' item, which
955 removes it from the todo list but does not delete it.
958 * Reprioritizing Items::
959 * Moving and Deleting Items::
963 @node Reprioritizing Items, Moving and Deleting Items, , Relocating and Removing Items
964 @subsubsection Reprioritizing Items
966 There are three ways to change a todo item's priority:
971 Raise the current item's priority by one, exchanging its position in the list
972 with that of the item directly above it (@code{todo-raise-item-priority}).
975 Lower the current item's priority by one, exchanging its position in the list
976 with that of the item directly below it (@code{todo-lower-item-priority}).
979 Prompt for a number and relocate the item to the corresponding
980 position in the list (@code{todo-set-item-priority}). For example,
981 entering @kbd{3} at the prompt makes the item the third in the
982 category, i.e., gives it third highest priority; all lower priority
983 items are pushed down by one. You can also pass the desired priority
984 as a numeric prefix argument, e.g., @kbd{3 #} gives the item third
985 highest priority without prompting. (Prefix arguments have no effect
986 with @kbd{r} or @kbd{l}.)
989 @node Moving and Deleting Items, Done Items, Reprioritizing Items, Relocating and Removing Items
990 @subsubsection Moving and Deleting Items
992 You can move an item to another category, thereby recategorizing it:
997 Move the item at point to another category (@code{todo-move-item}).
998 This prompts for a category to move the item to, displays that category,
999 prompts for the priority of the moved item in the category moved to and
1000 inserts the item accordingly. Minibuffer completion of the name of the
1001 category moved to works as with the navigation command @kbd{j}, and as
1002 with that command, passing a prefix argument prompts for a file and
1003 moves the item to a category in that file; and if the category name you
1004 enter is new, then you are asked whether to add the category to the
1005 file, and if you affirm, the item is moved to the new category.
1008 You can delete an item, thereby permanently (and, as far as Todo mode
1009 is concerned, irrevocably) removing it from the todo file:
1014 Delete the todo item at point (@code{todo-delete-item}; the binding is
1015 mnemonic for ``kill'', since @kbd{d} is used for marking items as done
1016 (@pxref{Done Items}); but note that @kbd{k} does not put the item into
1017 the kill ring). This command requires confirmation that you want to
1018 delete the item, since you cannot undo the deletion in Todo mode. (You
1019 could use @kbd{F e} to recover the item, but be aware that this would
1020 put the file in an inconsistent state, which you can recover from, but
1021 not without a risk; cf.@: the cautionary note in @ref{Reordering
1026 Todo commands that require user confirmation, such as @kbd{k}, use a
1027 modified form of @code{y-or-n-p}, which by default only accepts @kbd{y}
1028 or @kbd{Y}, but not @key{SPC}, as an affirmative answer. This is to
1029 diminish the risk of unintentionally executing the command, which is
1030 especially important with commands that do deletion, since there is no
1031 Todo command to undo a deletion. If you want to be able to use @key{SPC} for
1032 confirmation, enable the option @code{todo-y-with-space}.
1035 @node Done Items, , Moving and Deleting Items, Relocating and Removing Items
1036 @subsubsection Done Items
1038 When the activity or thing that a todo item is about has been done, it
1039 is natural to eliminate the item from the todo list. But instead of
1040 deleting it permanently, you may prefer to keep a record of your
1041 accomplishments by marking the item as done. In Todo mode, this removes
1042 the done item from the todo list, so as not to clutter it up, and stores
1043 it elsewhere. Such stored items form a record or diary of things done.
1044 The Todo package provides two such stores: the ``done items'' section of
1045 a Todo category, described here, and done item archives (@pxref{Todo
1050 @anchor{todo-item-done}
1052 This command (@code{todo-item-done}) removes the todo item at point
1053 from the todo list, appends to the original header a header consisting
1054 of @code{todo-done-string} (by default @samp{DONE }) and the current
1055 date, and if @code{todo-always-add-time-string} is enabled, also the
1056 current time, and adds the resulting done item to the top of the done
1057 items section of the category. Invoked with a prefix argument, it
1058 also prompts you to enter a comment, which is appended to the end of
1059 the done item, prefixed with @code{todo-comment-string} (by default
1063 A category's done items section is located below the last todo (i.e.,
1064 not done) item in the category. By default this section is hidden from
1065 view. There are two commands for viewing and hiding done items; since
1066 these are toggle commands, for convenience they also have a single key
1073 Make the done items section of the current category visible if it is
1074 hidden, or hide it if it is visible
1075 (@code{todo-toggle-view-done-items}). If you always want to see the
1076 done items section on entering a category, enable the option
1077 @code{todo-show-with-done}; you can still use @kbd{C v} or @kbd{v} to
1078 hide (and unhide) it.
1082 Toggle the standard category display in the current todo file, i.e.,
1083 display only the done items section of each category in the file, or if
1084 this is visible, hide it again and display only the todo items section
1085 (@code{todo-toggle-view-done-only}).
1088 Since done items are meant to be a record of your finished todo items,
1089 you cannot apply to them the same kinds of editing operations
1090 available to unfinished todo items. However, as explained in
1091 @ref{Editing Item Headers and Text} and repeated below for
1092 convenience, you can edit or delete a done item's comment, or
1093 retroactively add a comment. You can also relocate a done item, and
1094 you can revert its done status, making it an unfinished item again.
1099 Edit the current done item's comment, if it has one; otherwise, prompt
1100 for and add a comment.
1103 Delete the current done item's comment, if it has one.
1106 Move the done item at point to the top of the done items section of
1107 another category (@code{todo-move-item}). This is useful in case,
1108 after having finished a todo item and relocated it to its category's
1109 done items section, you create a category that is better suited to the
1110 content of the done item than its current category; in other words,
1111 you can retroactively recategorize the done item.
1114 If you decide the done item at point is not done after all, this command
1115 ``undoes'' it, i.e., restores it to the todo list of its category, with
1116 the priority you choose for it (@code{todo-item-undone}). If the done
1117 item has a comment, you are asked whether to delete it from the restored
1121 @node Todo Archives, Marked Items, Editing, Top
1122 @chapter Todo Archives
1124 When the done items section of a category itself starts to become
1125 cluttered, or if you just want to store some accomplished todo items in
1126 a separate file, you can move them to a Todo archive. This is a file
1127 with exactly the same structure as a todo file, i.e., divided into
1128 categories, but differs in that the categories contain only done items.
1129 Todo archives reside, like todo files, in @code{todo-directory} but have
1130 the extension @samp{.toda} instead of @samp{.todo}.
1133 * Creating and Visiting Archives::
1134 * Todo Archive Mode::
1137 @node Creating and Visiting Archives, Todo Archive Mode, , Todo Archives
1138 @section Creating and Visiting Archives
1140 Todo mode provides the following command for archiving items:
1145 This command (@code{todo-archive-done-item}) archives the done item at point.
1146 Invoked with a prefix argument, it archives all done items in the
1147 current todo category. If an archive for the current todo file
1148 already exists and contains a category with the same name as the
1149 current todo category, then this command moves the done item to the
1150 top of the corresponding archive category. If the archive exists but
1151 it does not have a corresponding category, this command creates the
1152 category in the archive and moves the done item to it. If no archive
1153 for the todo file exists, the command creates both the archive file,
1154 using the same base name as that of the todo file, as well as the
1155 category, and moves the done item to it.
1158 Typing @kbd{A d} is also the only way within the Todo mode package to
1159 create an archive file and its categories. Consequently, as a rule each
1160 archive file corresponds to exactly one todo file and has the same base
1161 name as this file, and each category in an archive file corresponds to
1162 and has the same name as a category in the corresponding todo file.
1163 Exceptions can only arise if you delete a todo file but not the
1164 corresponding archive, or if you delete a category in a todo file that
1165 has a corresponding category in an archive.
1167 You might be inclined to do the latter if you have archived all the
1168 items from a given todo category and you don't plan to add new items to
1169 it. In particular, if you have numerous such empty categories in a todo
1170 file, this can make sequential navigation in the file annoying. You can
1171 avoid this annoyance by deleting these categories, but only at the cost
1172 of putting the todo file out of synch with the archive file.
1174 You may find it preferable not to delete empty todo categories but to
1175 enable the option @code{todo-skip-archived-categories}. When this is
1176 non-@code{nil}, such empty todo categories are skipped over by the sequential
1177 category navigation commands @kbd{f} and @kbd{b}, so they don't distract you
1178 while navigating and you maintain the structural correspondence between
1179 todo and archive files (you can also still jump to empty todo categories
1182 If you rename a todo category that has a corresponding category in an
1183 archive, the archive category is also automatically identically renamed.
1184 Likewise, if you move such a todo category to another file; in this
1185 case, if there is no archive file corresponding to the todo file the
1186 category is moved to, then the archive is automatically created and the
1187 archived category is moved to it.
1189 There are two commands in Todo mode for visiting archive files:
1194 Switch to a buffer displaying the archived category corresponding to the
1195 current todo category (@code{todo-find-archive}). If the todo category
1196 has no archived items, the command asks if you want to visit the archive
1197 anyway. If there is no archive for this todo file, it asks if you want
1198 to visit another archive, which you can select via minibuffer
1202 Choose an archive to visit, whether or not the current todo file has an
1203 archive (@code{todo-choose-archive}).
1206 As with todo files, you can also visit a Todo archive by invoking a
1207 standard Emacs file-visiting command; this displays the first (on the
1208 initial invocation) or current category of the archive.
1210 @node Todo Archive Mode, , Creating and Visiting Archives, Todo Archives
1211 @section Todo Archive Mode
1213 When you visit a Todo archive, the buffer is in Todo Archive mode. It
1214 displays categories just as in Todo mode, except that they only contain
1215 done items. It provides the same sequential navigation commands as
1216 Todo mode: @kbd{f} and @kbd{b} navigate between the categories of the current
1217 archive, and @kbd{n} and @kbd{p} navigate between the done items of the current
1220 The commands @kbd{t} and @kbd{j} are also available in Todo Archive
1221 mode, and they work the same as in Todo mode, which means they can only
1222 be used to return to Todo mode: @kbd{t} prompt for and switch to a todo
1223 file, and with @kbd{j} you can only jump to a todo category. These
1224 commands exclude archives because an archive file has the same base name
1225 as the corresponding todo file, and category name completion uses only
1226 the base names, so the commands cannot know which type of file you want
1227 to visit. For this reason, there is a special command in Todo Archive
1228 mode for jumping to another archive category or visiting another archive
1234 This command (@code{todo-jump-to-archive-category}) prompts for a category in the
1235 current archive and jumps to it. Called with a prefix argument, it
1236 prompts for another archive, then for a category in it and jumps to
1240 None of the Todo mode editing commands are available in Todo Archive
1241 mode, since archives are meant to be static records of accomplished todo
1242 items. Should you, however, archive an item by mistake or simply change
1243 your mind about the archival status of an item, you can ``unarchive'' it:
1248 Restore the done item at point to the top of the done items section of
1249 the corresponding category in the corresponding todo file, i.e., an
1250 unarchived item remains a done item (@code{todo-unarchive-items}). When
1251 the last item in an archive category has been unarchived, the category
1252 is automatically deleted from the archive. If this was the only
1253 category in the archive, the archive file is also automatically deleted.
1256 Since it is natural to visit an archive from the corresponding todo
1257 file, it would be convenient to easily return to the todo file when you
1258 have finished browsing the archive. If you type @kbd{q} to quit Todo
1259 Archive mode, this switches to the corresponding todo file and shows the
1260 todo category corresponding to the archive category you were just
1263 The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
1264 Archive mode. It deletes the current archive file and prompts you
1265 whether to delete the corresponding todo file.
1267 @node Marked Items, Todo Categories Mode, Todo Archives, Top
1268 @chapter Marked Items
1270 For many item editing commands it can make sense and be convenient to
1271 apply them simultaneously to more than one item in the current category.
1272 Todo facilitates this by means of marked items.
1277 Mark the item at point if it is unmarked, and remove the mark it is
1278 already marked (@code{todo-toggle-mark-item}). The mark is a string
1279 specified by the option @code{todo-item-mark} (by default @samp{*})
1280 appended in front of the item header (more precisely, in front of the
1281 item's priority number or prefix; see @ref{Todo Display Features}, for
1282 details of the latter). After marking the current item, the command
1283 advances point to the next item. It also accepts a numeric prefix
1284 argument, which allows toggling the mark of multiple consecutive items.
1287 Mark all todo items in the current category.
1290 Unmark all todo item in the current category.
1293 You can also use the last two commands to mark or unmark all done items in
1294 the category, but only when only the done items section is being
1295 displayed, i.e., after invoking @kbd{C V} or @kbd{V}.
1297 The following commands operate on marked items:
1304 @kbd{m} (moving to another category)
1306 @kbd{d} (moving to the done items section; note that @kbd{C-u d} adds
1307 the same comment to all marked items)
1309 @kbd{A d} (archiving)
1311 @kbd{u} (both in Todo mode for undoing a done item and in Todo Archive
1312 mode for unarchiving an item)
1314 the commands for editing the item header (those beginning with the
1315 prefix @kbd{e d} as well as @kbd{e t}, @kbd{e y} and @kbd{e k})
1319 The item insertion, textual editing and priority changing commands do
1320 not operate on marked items.
1322 If you use @kbd{m}, @kbd{d}, @kbd{A d} or @kbd{u} on multiple
1323 noncontiguous marked items, the relocated items retain their relative
1324 order but are now listed consecutively en bloc.
1326 You can mark both todo and done items, but note that only @kbd{m} and
1327 @kbd{k} can apply to both; other commands only affect either marked
1328 todo or marked done items, so if both types of items are marked,
1329 invoking these commands has no effect and informs you of your
1332 @node Todo Categories Mode, Searching for Items, Marked Items, Top
1333 @chapter Todo Categories Mode
1335 It can be helpful to have a compact overview of the categories in a
1336 todo file and the types of items it contains; the Todo package
1337 provides a tabular view of this information.
1342 Typing this command (@code{todo-show-categories-table}) in Todo mode or Todo
1343 Archive mode switches to a buffer displaying a table that gives an
1344 overview of the categories in the current todo or archive file. This
1345 buffer is in Todo Categories mode.
1348 The table consists of a column containing the names of the categories in
1349 the file, followed by columns containing counts of certain types of
1350 items in each category. With todo files there are four count types: all
1351 todo (i.e., not done) items, diary items (i.e., those todo items lacking
1352 the @code{todo-nondiary-marker}, which hence can appear in the Fancy Diary
1353 display), done (but not archived) items, and archived items. With
1354 archive files all items are done, so the table only has a column for
1355 this count. The final row of the table gives total item counts across
1356 all categories in the file.
1358 Aside from explicitly invoking @kbd{F c} to display the table of
1359 categories, you can also arrange to have it displayed on the first
1360 invocation of @code{todo-show} for a given file (i.e., either using
1361 @code{todo-show} to initiate a Todo session, or calling it in Todo mode
1362 to visit another todo file). To do this customize the option
1363 @code{todo-show-first}.
1366 * Table of Item Counts::
1367 * Reordering Categories::
1370 @node Table of Item Counts, Reordering Categories, , Todo Categories Mode
1371 @section Table of Item Counts
1373 Above each column of the table is a labeled button you can press by
1374 clicking with the mouse or by typing @key{RET} on it. Pressing an item
1375 count button sorts the table alternately in ascending or descending
1376 order according to the type of count. Pressing the category button
1377 alternates between the initial numerical order of the categories and
1378 alphabetical order. In numerical order the column of category names is
1379 preceded by a column containing the corresponding category numbers; this
1380 column is not displayed in the alphabetical listing. Instead of
1381 pressing the buttons, you can also sort the table by typing the
1387 to sort by category numerically or alphabetically;
1389 to sort by todo item counts;
1391 to sort by diary item counts;
1393 to sort by done item counts;
1395 to sort by archived item counts.
1398 Each row of the table is also buttonized; pressing one of these exits
1399 the buffer (killing it), returns to the buffer of the file from which
1400 you had invoked @kbd{F c}, and displays the category that was named in
1401 the row button you pressed (i.e., pressing this button jumps to that
1402 category). However, if the category named in the row is in a todo
1403 file and all of its items have been archived, and you have enabled the
1404 option @code{todo-skip-archived-categories}, then pressing the button
1405 jumps to the archive category instead of the empty todo category. You
1406 can recognize such categories by their items counts in the table---all
1407 columns but the archived one have counts of zero---and in addition,
1408 their lines in the table are also distinguished from the others by a
1409 different face (@pxref{Faces}).
1411 You can navigate around the table:
1417 Advance point to the next button.
1421 Put point on the previous button.
1424 These commands are cyclic, e.g., when point is on the last button,
1425 pressing @kbd{n} moves it to the first button.
1427 Typing @kbd{q} exits Todo Categories mode, killing the buffer and returning
1428 to the current category in the Todo mode or Todo Archive mode buffer
1429 from which you had invoked @kbd{F c}.
1431 @node Reordering Categories, , Table of Item Counts, Todo Categories Mode
1432 @section Reordering Categories
1434 Todo Categories mode provide commands with which you can change the
1435 numbering of the categories in the current file. This renumbering has
1436 the effect of reordering the categories for sequential navigation by
1437 @kbd{f} and @kbd{b} in Todo mode and Todo Archive mode. These commands
1438 are only operative when the table displays the categories in their
1439 numerical order. They work just like reprioritizing items in Todo mode,
1440 hence have the same key bindings:
1445 Raise the current line of the table (the one the cursor is on),
1446 decreasing the category's number by one (@code{todo-raise-category}).
1447 This command exchanges lines, and hence the numbers, of the category at
1448 point and the one above it before invoking the command.
1451 Lower the current line of the table, increasing the category's number by
1452 one (@code{todo-lower-category}). This command exchanges lines, and
1453 hence the numbers, of the category at point and the one below it before
1454 invoking the command.
1457 Prompt for a number between 1 and the number of categories in the file
1458 and reorder the table accordingly (@code{todo-set-category-number}). If
1459 called with a numeric prefix argument within the allowed range, reorder
1460 the table without prompting.
1463 The reordering done by these commands remains in effect when you return
1464 to Todo mode or Todo Archive mode and, as long as you save the todo
1465 or archive file after reordering, in subsequent sessions as well.
1467 @quotation @strong{Caution}
1468 It is important to be aware that renumbering the categories does not
1469 change the textual order of the categories in the file. This is
1470 significant if you should invoke @kbd{F e} to edit the entire file
1471 manually and in so doing alter the number of categories or the number
1472 of items in a category: this will make the information shown in the
1473 table of categories of this file inconsistent with its actual state.
1474 You can repair this inconsistency by invoking the command
1475 @code{todo-repair-categories-sexp} (which lacks a key binding, since
1476 it is meant to be a rarely needed rescue operation). But this will
1477 revert any renumbering of the categories you have made, so you will
1478 have to renumber them again. This is one reason why you should
1479 exercise caution when using @kbd{F e}.
1482 @node Searching for Items, Todo Filtered Items Mode, Todo Categories Mode, Top
1483 @chapter Searching for Items
1485 It can be useful to be able to locate and examine all todo items that
1486 fit certain criteria, regardless of which category they belong to. One
1487 way to do this in Todo mode is by sequentially searching in the file:
1492 This command (@code{todo-search}; the key is capital @kbd{S}) prompts for a
1493 regular expression, searches from the beginning of the current todo file
1494 and displays the category containing the first match it finds, with the
1495 match highlighted. If there are further matches, a message saying how
1496 many are left is displayed and you are asked if you want to go to the
1497 next match. When you reach the last match, or if you decide not to go
1498 to further matches, you are asked whether the match highlighting should
1502 This command (@code{todo-clear-matches}) removes any highlighting added by @kbd{S}.
1503 This is so you can leave the matches highlighted at the end of the
1504 search and remove the highlighting later.
1507 These commands are also available in Todo Archive mode.
1509 @node Todo Filtered Items Mode, Todo Display Features, Searching for Items, Top
1510 @chapter Todo Filtered Items Mode
1512 A more powerful alternative to sequential searching is item filtering,
1513 by which items from different categories that match specified criteria
1514 are gathered and displayed in a new buffer as a kind of virtual
1515 category in a distinct mode, Todo Filtered Items mode.
1519 * Todo Filtered Items Mode Commands::
1520 * Files of Filtered Items::
1523 @node Filtering Items, Todo Filtered Items Mode Commands, , Todo Filtered Items Mode
1524 @section Filtering Items
1526 Todo mode provides three ways to filter items: a general filter for
1527 items matching a user-entered regular expression, as with the search
1528 command; and two specific filters, one for diary-displayable items
1529 (i.e., those lacking @code{todo-nondiary-marker}) and one for top
1530 priority items (more on the latter below). The commands for each
1531 filter come in pairs, one for filtering just the current todo file and
1532 one for filtering a user-specified list of todo files. Thus, there
1533 are six item filtering commands:@footnote{The use of @kbd{F} in the key
1534 sequences of these commands naturally recalls ``filter'', but is also
1535 consistent with the Todo mode mnemonic key binding convention, since the
1536 commands involve one or more whole files.}
1541 @kbd{F x x} (@code{todo-filter-regexp-items})
1543 @kbd{F x m} (@code{todo-filter-regexp-items-multifile})
1545 @kbd{F y y} (@code{todo-filter-diary-items})
1547 @kbd{F y m} (@code{todo-filter-diary-items-multifile})
1549 @kbd{F t t} (@code{todo-filter-top-priorities})
1551 @kbd{F t m} (@code{todo-filter-top-priorities-multifile})
1554 There are two ways to specify which files the multifile filtering
1555 commands apply to. If there are files you want to filter every time you
1556 use these commands, customize the option @code{todo-filter-files}. If you
1557 leave this option empty (the default), invoking a multifile filtering
1558 command pops up a buffer similar to the Customization buffer for
1559 @code{todo-filter-files}, in which you can select files to filter just for
1562 Diary and top priority items are by definition non-done todo items, but
1563 when filtering by regular expression, you can extend the scope of the
1564 command to done items by enabling the option @code{todo-filter-done-items}.
1565 Then @kbd{F x x} and @kbd{F x m} will gather both matching todo and matching
1566 done items (including done items from any archive files corresponding to
1567 the selected todo files) into the virtual category of filtered items.
1569 There are several ways to specify how many items in each category count
1570 as top priorities and hence get filtered by @kbd{F t t} and @kbd{F t m}:
1575 The option @code{todo-top-priorities} specifies a single default number
1576 for all categories and all todo files; its default value is 1, which
1577 means just the highest priority item in every category is filtered,
1578 unless otherwise specified.
1580 The option @code{todo-top-priorities-overrides} lists file-wide overrides
1581 of @code{todo-top-priorities} as well as category-specific overrides. It
1582 is empty by default. However, using the Custom facility to set this
1583 option would be tedious and error-prone, so instead you should use the
1584 commands @kbd{F t s} and @kbd{C t s}. The former sets (i.e., overrides) the
1585 default number of top priorities for all categories in the current
1586 todo file, and the latter sets the number of top priorities for the
1587 current category. To exclude a category or file from filtering by @kbd{F t t}
1588 and @kbd{F t m}, set the number to @samp{0}.
1590 You can invoke @kbd{F t t} and @kbd{F t m} with a numeric prefix argument,
1591 which specifies the number of top priorities in each category just for
1592 this invocation, overriding both @code{todo-top-priorities-overrides} and
1593 @code{todo-top-priorities}.
1596 @node Todo Filtered Items Mode Commands, Files of Filtered Items, Filtering Items, Todo Filtered Items Mode
1597 @section Todo Filtered Items Mode Commands
1599 The output of the item filtering commands looks similar to a regular
1600 Todo category, but it is not contained in any todo file and does not
1601 have a name on being created, so it is not a ``real'' category but a
1602 ``virtual'' category. Another difference is the lack of a done items
1603 section; either there are no done items in the list (when the filtered
1604 items are diary or top priority items), or these are displayed in the
1605 same list as todo items (if you filtered by regular expression and
1606 allowed done items). A further difference is that the items have an
1607 additional header, between the item's date/time header and its text,
1608 specifying which category (and if you invoked a multifile command, also
1609 which file) the item comes from, and if you filtered by regular
1610 expression, also whether the item comes from a Todo archive.
1612 The sequential item navigation commands @kbd{n} and @kbd{p} work the same in
1613 Todo Filtered Items mode as in Todo mode, as do the file and category
1614 jumping commands @kbd{t} and @kbd{j}; however, the sequential category
1615 navigation commands are unavailable, since virtual categories of
1616 filtered items are not ordered with respect to ``real'' categories. In
1617 addition, Todo Filtered Items mode provides a special navigation
1624 If you type this command (@code{todo-go-to-source-item}) with point on a
1625 filtered item, the buffer switches to the item's source file (in Todo
1626 mode or Todo Archive mode, as the case may be) and displays its
1627 category, with point on the item.
1630 Filtered items cannot be textually edited, moved to another category,
1631 marked done or archived like items in a real todo category, since these
1632 would then be out of synch with each other. But there is one type of
1633 editing command that does work in Todo Filtered Items mode: changing an
1641 These commands raise, lower, or set, respectively, the current item's
1642 priority in the virtual category.
1646 Using these commands, you can create a cross-category (and even
1647 cross-file) prioritized list of filtered items. However, there is a
1648 restriction on these commands in Todo Filtered Items mode: you cannot
1649 change the relative priorities of items from the same real category,
1650 since that would make the filtered list inconsistent with the source
1653 @node Files of Filtered Items, , Todo Filtered Items Mode Commands, Todo Filtered Items Mode
1654 @section Files of Filtered Items
1656 Typing @kbd{s} in Todo Filtered Items mode saves the buffer of filtered
1657 items to a file in @code{todo-directory}. Files of items filtered by
1658 regular expression have the extension @samp{.todr}, those with filtered
1659 diary items have the extension @samp{.tody} and those with filtered top
1660 priorities have the extension @samp{.todt}. The extensions are added
1661 automatically the first time you save the buffer to a file.
1663 With filtered top priority or diary items, the file is automatically
1664 named on first saving it, using as the base name either the same base
1665 name as the single todo file it was generated from, or combining the
1666 base names of the todo files used in multifile filtering commands.
1667 With items filtered by regular expression, it can be useful to save
1668 separate lists generated from the same file(s) using different regular
1669 expressions, so when saving such a list, you are prompted for a short
1670 identifying string to add to the file name.
1672 When you invoke one of the item filtering commands without a prefix
1673 argument and a corresponding file already exists, the command visits
1674 this file (if, for the current file or chosen files, there are multiple
1675 files of items filtered by regular expression, you are prompted to
1676 choose one). To force generation of a new filtered list, invoke the
1677 command with a prefix argument (in the case of top priority items,
1678 either numeric as described above, or the raw prefix argument @kbd{C-u} to
1679 use the values of @code{todo-top-priorities-overrides} or
1680 @code{todo-top-priorities}).
1682 Aside from explicitly invoking an item filtering command to display a
1683 saved list of items filtered by a given method from given todo files,
1684 there are two other ways to visit a saved file of filtered items. You
1685 can invoke a command similar to @code{find-file}:
1689 Visit a saved file of filtered items, which you choose via minibuffer
1690 completion (@code{todo-find-filtered-items-file}).
1694 Alternatively, as with tables of categories, by customizing
1695 @code{todo-show-first} you can have the first invocation of
1696 @code{todo-show} for a given todo file display the corresponding saved
1697 file of filtered items. If there is no saved filtered items list for
1698 the file, @code{todo-show} simply defaults to visiting the file and
1699 displaying its first category, as usual.
1701 The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
1702 Filtered Items mode. It deletes the current filtered items file.
1704 @node Todo Display Features, Printing Todo Buffers, Todo Filtered Items Mode, Top
1705 @chapter Todo Display Features
1707 You can change the appearance of Todo mode buffers in a variety of ways.
1712 * Other Display Commands and Options::
1715 @node Faces, Item Prefix, , Todo Display Features
1718 Each of the Todo modes uses faces to distinguish various aspects of
1719 the display, both structural and informational. For example, the
1720 faces for the date and time strings of todo item headers
1721 (@code{todo-date} and @code{todo-time}, respectively) by default
1722 inherit the attributes of the corresponding faces used by the Emacs
1723 diary; but when the date and time of a Todo diary item (i.e., an item
1724 lacking @code{todo-nondiary-marker}) is earlier than the current date
1725 and time, they are displayed in a different face
1726 (@code{todo-diary-expired}). In this way, you can readily recognize
1727 diary items that have ``expired'' and act accordingly (e.g., by
1728 tagging them as done or by updating the deadlines).
1730 Another example of an informational face is the face used to
1731 distinguish top priority items (@code{todo-top-priority}). A third
1732 case is the face used in Todo Categories mode to mark rows of the
1733 table containing categories with only archived items
1734 (@code{todo-archived-only}).
1736 The @code{todo-faces} customization group contains a complete list of
1737 Todo mode faces and brief descriptions of their use.
1740 @node Item Prefix, Other Display Commands and Options, Faces, Todo Display Features
1741 @section Item Prefix
1743 In the default display of (real or virtual) categories in Todo mode,
1744 Todo Archive mode and Todo Filtered Item mode the items are visually
1745 numbered in ascending order, starting with @samp{1} on the top item,
1746 displayed to the left of its header (date/time string). With todo items
1747 the numbers indicate each item's priority in the list, so when you
1748 reprioritize an item with @kbd{#} or move it with @kbd{m}, these numbers make
1749 it easier to choose the item's new priority. The numbering also lets
1750 you to see at a glance how many items there are in the list. When an
1751 item is inserted, deleted, or moved, the numbering is automatically
1752 updated. In Todo mode, the todo and done items sections in each
1753 category are separately numbered.
1755 If you prefer not to have item numbering displayed, disable the option
1756 @code{todo-number-prefix}; then the display of each item starts by default
1757 simply with its header. But you can also replace the numbering with a
1758 visually distinctive string of your choice by customizing the option
1759 @code{todo-prefix} (the empty string by default). Another alternative is to
1760 temporarily hide the item numbering:
1766 Toggle between displaying item numbering and displaying the
1767 @code{todo-prefix} string in the current Todo file (todo, archive, or
1768 saved virtual category of filtered items). (This command also works in
1769 buffers of filtered items that have not yet been written to a file.)
1772 In the todo items section of each Todo mode category, the item prefix
1773 (whether a priority number or a fixed string) of the top priority
1774 items (determined as specified in @pxref{Filtering Items}) is
1775 displayed in a face (@code{todo-top-priority}) different from the face
1776 of the prefix of non-top-priority items, so you see at a glance how
1777 many items in the category are top priorities.
1779 @node Other Display Commands and Options, , Item Prefix, Todo Display Features
1780 @section Other Display Commands and Options
1782 There are two additional toggle commands that affect display in the
1789 Hide the item headers if visible, or show them if they are hidden.
1790 With done items, only the done header (i.e., the done tag and date-time
1791 string inserted when the item was marked done) is hidden, the original
1792 date-time string is not. With filtered items, the category (or
1793 category-file) tag is not hidden.
1797 Highlight the current item (with the face @code{hl-line}) if
1798 unhighlighted, or remove its highlighting. When item highlighting is
1799 enabled, it follows navigation by @kbd{n} or @kbd{p}. If you want to
1800 have current item highlighting by default, enable the option
1801 @code{todo-highlight-item}. @kbd{F H} or @kbd{H} will still toggle
1805 There are two options which affect the display of items whose content is
1806 longer than one screen line:
1811 @code{todo-indent-to-here} sets the amount of indentation for all lines
1812 after the first in multiline todo items, which is necessary in order
1813 for todo diary items to be fully visible in the Fancy Diary display.
1814 The default indentation is 3 spaces. For a uniform appearance this
1815 option applies to all items, i.e., diary and nondiary todo items and
1819 @code{todo-wrap-lines} allows you to choose, for the purposes of
1820 insertion and editing, between treating multiline todo items as
1821 containing multiple logical lines with hard line breaks or as multiple
1822 visual lines using Visual Line mode; the latter is the default. Since
1823 multiparagraph items also contain hard line breaks in Visual Line mode,
1824 for a uniform appearance this display shows indentation on wrapped lines
1825 by using a wrap-prefix of @code{todo-indent-to-here} spaces.
1828 The indentation inserted after a hard newline is actually a tab
1829 character, and the Todo modes that display items bind @code{tab-width} to
1830 @code{todo-indent-to-here}, so if you change the default value of the
1831 latter, the next time you visit a Todo file, the indentation will
1832 reflect your change.
1834 By default, the todo and done items sections of a todo category are
1835 visually separated by a line as wide as the window the buffer is
1836 displayed in. You can change the appearance and width of the separator
1837 by customizing @code{todo-done-separator-string}; you can also change the
1838 face of the separator string (@code{todo-done-sep}).
1840 There are also several options for changing the appearance in Todo
1841 Categories mode and Todo Filtered Items mode, beyond those mentioned
1842 above in the sections on these modes; see the customization groups
1843 @code{todo-categories} and @code{todo-filtered} for details.
1845 @node Printing Todo Buffers, Legacy Todo Mode Files, Todo Display Features, Top
1846 @chapter Printing Todo Buffers
1848 If you print a Todo buffer using one of the standard Emacs printing
1849 commands, it does not look exactly like what you see in the buffer.
1850 This is because some of the display features are non-printable
1851 (specifically, those using overlays, word-wrap and wrap-prefix). Todo
1852 mode provides two print commands that produce output which includes
1853 printable counterparts of such display features:
1858 Send the printable buffer output directly to your printer.
1861 Prompt for a file name and write the printable output to that file.
1864 By default, Todo uses @code{ps-print-buffer-with-faces} to make the
1865 printable version; you can change this by setting the option
1866 @code{todo-print-function}.
1868 @node Legacy Todo Mode Files, GNU Free Documentation License, Printing Todo Buffers, Top
1869 @chapter Legacy Todo Mode Files
1871 Users of the original version of Todo mode will recognize from the
1872 description in this user manual that, although the new version shares
1873 with the original version the same basic user interface and handling of
1874 todo items, there are some incompatible differences between them, such
1875 as the done items sections (there are also other file format
1876 incompatibilities behind the scenes that are normally not visible to
1879 The most significant incompatibility concerns the item prefix. In the
1880 earlier version of Todo mode the prefix was the initial part of the item
1881 string itself, so in order for the item to be displayable in the Emacs
1882 diary, the prefix had to be a date/time pattern recognizable by the
1883 diary (although the todo item also has its own date/time header).
1884 Moreover, since all items had the same prefix string in the original
1885 version, this means that either only all or no items could appear in the
1886 Fancy Diary display on any given date. This considerably restricts the
1887 practicality of including todo items in the diary. In contrast, the
1888 current version of Todo mode uses overlays for item priority numbering
1889 or prefixes, and item-specific diary-compatible date/time headers and
1890 special marks for todo items to be excluded from the diary, so you can
1891 determine for each item whether and when it appears in the Fancy Diary
1894 Due to these incompatibilities, files created with the original version
1895 of Todo mode cannot be displayed or edited with the current version.
1896 However, this version provides a function that converts the two main
1897 types of files used by the original version into new-style valid todo
1898 and archive files, respectively, and saves them in
1899 @code{todo-directory}.@footnote{The original version of Todo mode also
1900 allowed saving a file of top priority items, but since you can readily
1901 create such a file with the new version, which is also more flexible,
1902 no conversion is provided for this file.}
1904 This conversion function is automatically called the first time you
1905 invoke @code{todo-show} (i.e., before you have created a todo file with
1906 the new version), and if it finds the old-style files, it offers to
1907 convert them, making them the first new-style todo and archive files.
1908 If you choose not to convert the old-style files at this time, you can
1909 do so later by invoking the command @code{todo-convert-legacy-files}
1910 (there is no key binding for it, since it shouldn't be necessary to use
1911 it often). (A delicate part of the conversion concerns the customizable
1912 format of item date/time headers in the old-style; see the documentation
1913 string of @code{todo-legacy-date-time-regexp} for details.)
1915 @node GNU Free Documentation License, , Legacy Todo Mode Files, Top
1916 @appendix GNU Free Documentation License
1917 @include doclicense.texi