8.2 Reordering Categories

Todo Categories mode provide commands with which you can change the numbering of the categories in the current file. This renumbering has the effect of reordering the categories for sequential navigation by f and b in Todo mode and Todo Archive mode. These commands are only operative when the table displays the categories in their numerical order. They work just like reprioritizing items in Todo mode, hence have the same key bindings:

r

Raise the current line of the table (the one the cursor is on), decreasing the category’s number by one (todo-raise-category). This command exchanges lines, and hence the numbers, of the category at point and the one above it before invoking the command.

l

Lower the current line of the table, increasing the category’s number by one (todo-lower-category). This command exchanges lines, and hence the numbers, of the category at point and the one below it before invoking the command.

#

Prompt for a number between 1 and the number of categories in the file and reorder the table accordingly (todo-set-category-number). If called with a numeric prefix argument within the allowed range, reorder the table without prompting.

The reordering done by these commands remains in effect when you return to Todo mode or Todo Archive mode and, as long as you save the todo or archive file after reordering, in subsequent sessions as well.

Caution: It is important to be aware that renumbering the categories does not change the textual order of the categories in the file. This is significant if you should invoke F e to edit the entire file manually and in so doing alter the number of categories or the number of items in a category: this will make the information shown in the table of categories of this file inconsistent with its actual state. You can repair this inconsistency by invoking the command todo-repair-categories-sexp (which lacks a key binding, since it is meant to be a rarely needed rescue operation). But this will revert any renumbering of the categories you have made, so you will have to renumber them again. This is one reason why you should exercise caution when using F e.