todo-mode.texi 81 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922
  1. \input texinfo.tex @c -*-texinfo-*-
  2. @c %**start of header
  3. @setfilename ../../info/todo-mode.info
  4. @settitle Todo Mode User Manual
  5. @include docstyle.texi
  6. @syncodeindex fn cp
  7. @syncodeindex vr cp
  8. @syncodeindex ky cp
  9. @c %**end of header
  10. @copying
  11. Copyright @copyright{} 2013-2017 Free Software Foundation, Inc.
  12. @quotation
  13. Permission is granted to copy, distribute and/or modify this document
  14. under the terms of the GNU Free Documentation License, Version 1.3 or
  15. any later version published by the Free Software Foundation; with no
  16. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  17. and with the Back-Cover Texts as in (a) below. A copy of the license
  18. is included in the section entitled ``GNU Free Documentation License''.
  19. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  20. modify this GNU manual.''
  21. @end quotation
  22. @end copying
  23. @dircategory Emacs misc features
  24. @direntry
  25. * Todo Mode: (todo-mode). Make and maintain todo lists.
  26. @end direntry
  27. @titlepage
  28. @title Todo Mode User Manual
  29. @subtitle Facilities for making and maintaining todo lists.
  30. @author Stephen Berman
  31. @page
  32. @vskip 0pt plus 1filll
  33. @insertcopying
  34. @end titlepage
  35. @contents
  36. @ifnottex
  37. @node Top
  38. @top Todo Mode User Manual
  39. This manual describes the version of Todo mode first appearing in
  40. Emacs 24.4.
  41. @insertcopying
  42. @end ifnottex
  43. @menu
  44. * Overview::
  45. * Todo Mode Entry Points::
  46. * Key Binding Conventions::
  47. * Navigation:: Moving within and between categories.
  48. * Editing:: Adding, deleting and changing todo
  49. files, categories and items.
  50. * Todo Archives:: Files of done todo items.
  51. * Marked Items:: Acting on multiple items simultaneously.
  52. * Todo Categories Mode:: Table of categories and item counts.
  53. * Searching for Items::
  54. * Todo Filtered Items Mode:: Making virtual categories of items from
  55. different categories and files.
  56. * Todo Display Features::
  57. * Printing Todo Buffers::
  58. * Legacy Todo Mode Files:: Converting old-style todo files.
  59. * GNU Free Documentation License::
  60. @detailmenu
  61. --- The Detailed Node Listing ---
  62. Overview
  63. * Levels of Organization::
  64. * Todo Items as Diary Entries::
  65. Editing
  66. * File Editing::
  67. * Category Editing::
  68. * Item Editing::
  69. Item Editing
  70. * Inserting New Items::
  71. * Editing Item Headers and Text::
  72. * Relocating and Removing Items::
  73. Relocating and Removing Items
  74. * Reprioritizing Items::
  75. * Moving and Deleting Items::
  76. * Done Items::
  77. Todo Archives
  78. * Creating and Visiting Archives::
  79. * Todo Archive Mode::
  80. Todo Categories Mode
  81. * Table of Item Counts::
  82. * Reordering Categories::
  83. Todo Filtered Items Mode
  84. * Filtering Items::
  85. * Todo Filtered Items Mode Commands::
  86. * Files of Filtered Items::
  87. Todo Display Features
  88. * Faces::
  89. * Item Prefix::
  90. * Other Display Commands and Options::
  91. @end detailmenu
  92. @end menu
  93. @node Overview, Todo Mode Entry Points, Top, Top
  94. @chapter Overview
  95. The Todo mode package provides facilities for making and maintaining
  96. todo lists. A todo list is a list of todo items---things to do (in the
  97. widest sense)---arranged in order of priority, with the highest priority
  98. item at the top of the list and the lowest priority item at the bottom.
  99. This manual describes the Todo mode user interface. Todo mode comprises
  100. a large number of commands and user options for creating, displaying,
  101. navigating and editing todo lists, distributed across five major modes.
  102. The principle major mode is Todo mode; the other four (Todo Edit mode,
  103. Todo Archive mode, Todo Categories mode, and Todo Filtered Items mode)
  104. are subsidiary to and accessible from Todo mode.
  105. This version of Todo mode greatly expands on, and in significant ways
  106. differs from, the original version; for details and consequences of the
  107. most important differences, @ref{Legacy Todo Mode Files}.
  108. @menu
  109. * Levels of Organization::
  110. * Todo Items as Diary Entries::
  111. @end menu
  112. @node Levels of Organization, Todo Items as Diary Entries, , Overview
  113. @section Levels of Organization
  114. In Todo mode each todo list is identified with a named category, so you
  115. can group together thematically related todo items. Each category is
  116. stored in a file, which thus provides a further level of organization.
  117. You can create as many todo files, and in each as many categories, as
  118. you want.
  119. All todo files reside in a single directory, whose location is specified
  120. by the user option @code{todo-directory}. This directory may also
  121. contain other types of Todo files, which are discussed later
  122. (@pxref{Todo Archive Mode} and @ref{Todo Filtered Items Mode}).
  123. @c Emacs recognizes Todo files by their extension, so when you visit
  124. @c the files the buffer is in the appropriate mode and the current
  125. @c category is correctly displayed.
  126. When you use a Todo mode command to create a todo file, the extension
  127. @samp{.todo} is automatically added to the base name you choose (as a
  128. rule, this name is also used for the other types of Todo files, which
  129. have their own extensions). As a user, you only have to deal with the
  130. base name of a Todo file.
  131. When you create a new todo file, you must also add at least one category
  132. to it, and each todo item belongs to a category. It is not possible to
  133. have an uncategorized todo list, but you can always make a catch-all
  134. category with a generic name like ``Todo'', which is in fact the default
  135. name assigned to the first category when you create a new todo file, if
  136. you don't provide a different name; you can change the default by
  137. customizing @code{todo-initial-category}.
  138. The most basic level of organization is the todo item itself, since it
  139. contains the information about what you want to do. As detailed in
  140. subsequent sections of this manual, most Todo mode commands and user
  141. options concern ways of classifying and deploying this information by
  142. associating various kinds of metadata with it, e.g., the category it
  143. belongs to, its priority, whether it is to be included in the Emacs
  144. diary, date and time stamps, whether it is done or still to do.
  145. @node Todo Items as Diary Entries, , Levels of Organization, Overview
  146. @section Todo Items as Diary Entries
  147. You can have todo items show up in the Emacs Fancy Diary display by
  148. including the todo file in your diary file (@pxref{Fancy Diary
  149. Display,,, emacs}). This effectively augments the Emacs diary with
  150. categorized diary entries. All items in an included todo file will
  151. appear in the Fancy Diary display except for those that are marked
  152. with @code{todo-nondiary-marker}. You can add or omit this marking
  153. upon creating a new todo item, or you can do so by editing an existing
  154. item, see @ref{Inserting New Items} and @ref{Editing Item Headers and
  155. Text} for details.
  156. To ensure the proper display of todo items in the Fancy Diary display,
  157. they must have the format of diary entries, i.e., they have to begin
  158. with a date string recognized by the Emacs diary,@footnote{Two types of
  159. dates recognized by the Emacs diary are not supported in the current
  160. Todo mode implementation: sexp diary entries and date strings in which
  161. the year is omitted (however, the latter type is equivalent to using
  162. @samp{*} for an arbitrary year, which Todo mode does support).} and if
  163. they are longer than one line, all lines but the first must begin with
  164. white space. Todo mode ensures that these requirements are satisfied
  165. (@pxref{Other Display Commands and Options}).
  166. The Fancy Diary display is also Todo mode aware: if it contains an item
  167. from a Todo mode file, clicking or typing @key{RET} on this item will
  168. switch to the buffer visiting that file and properly display the item's
  169. category, with point on the item.
  170. @node Todo Mode Entry Points, Key Binding Conventions, Overview, Top
  171. @chapter Todo Mode Entry Points
  172. To initialize your first todo file, invoke the command @code{todo-show}.
  173. This prompts you for a file name (defaulting to the value of
  174. @code{todo-initial-file}), prompts you for the name of the first
  175. category (defaulting to the value of @code{todo-initial-category}),
  176. creates and visits the file and displays the category in Todo mode, and
  177. then prompts you to enter the first item. If you choose not to enter an
  178. item now, simply type @kbd{C-g}, which leaves the category empty but
  179. otherwise well-formed. If you prefer not to be prompted to enter an
  180. item on adding a new category, disable the option
  181. @code{todo-add-item-if-new-category}.
  182. Once at least one todo file exists, invoking @code{todo-show} enters
  183. Todo mode. Invoked with a prefix argument, the command prompts for
  184. which todo file to visit. Otherwise, the first invocation of this
  185. command after loading the Todo mode package visits the default todo file
  186. (option @code{todo-default-todo-file}) and shows its first category.
  187. (You can get a different display with the first invocation of
  188. @code{todo-show} by customizing the option @code{todo-show-first};
  189. @pxref{Todo Categories Mode} and @ref{Files of Filtered Items}.)
  190. If you leave Todo mode and later invoke @code{todo-show} to re-enter it,
  191. by default this returns you to the current (i.e., last displayed)
  192. category of the current todo file, which is the one in the most recently
  193. selected and still live buffer visiting a todo file. If you disable the
  194. option @code{todo-show-current-file}, then non-initial invocations of
  195. @code{todo-show} always return to the first or current category of the
  196. default todo file.
  197. If you want to enter Todo mode and go directly to a specific category
  198. instead the first or current category in the current or default todo
  199. file, use the command @code{todo-jump-to-category}; @ref{Navigation},
  200. for details. You can also enter Todo mode by invoking the command
  201. @code{todo-insert-item}; @ref{Inserting New Items}, for details.
  202. The most convenient way to use these commands to enter Todo mode is to
  203. define global key bindings for them in your init file. Good choices
  204. are @kbd{C-c t} for @code{todo-show}, @kbd{C-c j} for
  205. @code{todo-jump-to-category} and @kbd{C-c i} for
  206. @code{todo-insert-item}, since these commands are bound to @kbd{t},
  207. @kbd{j} and @kbd{i}, respectively, in Todo mode.
  208. @c You can also visit a Todo file via @code{find-file} or Dired, like any
  209. @c other file, and since Emacs recognizes it, the buffer will automatically
  210. @c be in the appropriate Todo mode. Moreover, as long as the command you
  211. @c use to visit the file is listed in the option
  212. @c @code{todo-visit-files-commands} (which by default contains
  213. @c @code{find-file} and @code{dired-find-file}), it will also correctly
  214. @c display the file's first category on first visiting the file (otherwise
  215. @c you have to use one of the commands for navigating between categories in
  216. @c order to get a proper display).
  217. You can leave Todo mode by typing @kbd{q} (@code{todo-quit}), which
  218. buries the current todo file buffer. Doing this also saves any changes
  219. you have made to the file, and leaves both the file and the category
  220. that was displayed on quitting current for subsequent Todo mode commands
  221. (unless the buffer made current by quitting is visiting another file and
  222. category in Todo mode, in which case the latter become current for Todo
  223. mode commands).
  224. @node Key Binding Conventions, Navigation, Todo Mode Entry Points, Top
  225. @chapter Key Binding Conventions
  226. For Todo mode commands to function properly, it is essential to maintain
  227. the correct format at all three levels of organization---item, category,
  228. and file. Todo mode tries to minimize the risk of format corruption by
  229. hiding certain parts of the format from the user, making the buffer
  230. read-only and suppressing the self-insertion keys. Consequently, it is
  231. normally impossible to make changes to your todo files without
  232. explicitly invoking Todo mode commands.
  233. A beneficial side effect of this restrictiveness is that you can invoke
  234. almost all Todo commands by typing ordinary printing characters, either
  235. singly or in specified sequences, without using modifier keys, except
  236. for the shift key for capitalization and the raw prefix argument
  237. @kbd{C-u}; numeric prefix arguments can be entered just by typing a
  238. number key.
  239. The predefined key bindings in Todo are more or less mnemonic. As a
  240. rule, key sequences beginning with @kbd{C} (capital @samp{C}, not the
  241. control key) are bound to commands applying to categories, sequences
  242. beginning with @kbd{F} apply to (non-archive) file-level commands, and
  243. those beginning with @kbd{A} apply to archives (a special type of Todo
  244. file; @ref{Todo Archive Mode}). Todo commands applying to items,
  245. which constitute the majority, are bound to lower case key sequences.
  246. @node Navigation, Editing, Key Binding Conventions, Top
  247. @chapter Navigation
  248. The navigation commands are for making another todo file, category, or
  249. item the current one by moving point to it.@footnote{Many editing
  250. commands can also do this by side effect, but since that is not their
  251. main function, they are not included in this section.} Since these
  252. commands are likely to be used frequently and repetitively, it is
  253. convenient for their key bindings to be single lower case keys, even for
  254. navigation commands applying to categories and files.
  255. Two of the navigation commands were already mentioned in @ref{Todo
  256. Mode Entry Points}:
  257. @table @kbd
  258. @item t
  259. Display another todo file in the selected window (@code{todo-show}).
  260. When you invoke this command in Todo mode, it prompts for a file name,
  261. which you can choose via minibuffer completion (like invoking
  262. @code{todo-show} with a prefix argument outside of Todo mode). If a
  263. buffer is already visiting that file, it displays its current category;
  264. if invoking @kbd{t} opens the file, it display its first category (by
  265. default; see the option @code{todo-show-first} for other possibilities).
  266. @item j
  267. Display another todo category in the selected window
  268. (@code{todo-jump-to-category}). When you invoke this command, it
  269. prompts for a category name, which you can choose via minibuffer
  270. completion. The candidates for completion include the categories in the
  271. current todo file as well as those in the files listed in the option
  272. @code{todo-category-completions-files}. If you type @key{RET} without
  273. choosing a category, the current category of the current todo file is
  274. automatically selected (this can be a useful shortcut when you invoke
  275. @code{todo-jump-to-category} outside of Todo mode). If you type the
  276. name of a non-existing category, you can add this to the file as a new
  277. category and jump to it. If you invoke this command with a prefix
  278. argument, it first you prompts for which todo file to jump to (which you
  279. can also choose with minibuffer completion) and then for which category
  280. from that file; in this case, completion is only against the categories
  281. in the selected file.
  282. @end table
  283. It is also convenient to navigate back and forth sequentially between
  284. the categories of a single todo file. The categories of a todo file are
  285. numbered consecutively starting with @samp{1}.@footnote{A category's
  286. number is automatically assigned when the category is created: the
  287. category is appended to the end of the file, so its number is simply the
  288. highest until another category is added. There is no command in Todo
  289. mode to reorder the numbering of the categories in a todo file, but this
  290. is possible from the file's table of categories; @ref{Todo Categories
  291. Mode}.} The current category's number and name appear in the mode line.
  292. @table @kbd
  293. @item f
  294. Move point to the first item of the category numerically directly
  295. following the current category (@code{todo-forward-category}).
  296. @item b
  297. Move point to the first item of the category numerically directly
  298. preceding the current category (@code{todo-backward-category}).
  299. @end table
  300. With @kbd{f} and @kbd{b} you can cycle through the categories, so for example,
  301. if the last category is current and you type @kbd{f}, then the first
  302. category becomes current.
  303. You can also navigate between the items in the current category:
  304. @table @kbd
  305. @item n
  306. Move point down to the next item below the current one (i.e., to the
  307. item with the next lower priority) (@code{todo-next-item}).
  308. @item p
  309. Move point up to the item directly above the current one (i.e., to the
  310. item with the next higher priority) (@code{todo-previous-item}).
  311. @end table
  312. These commands also accept a positive numeric prefix argument; e.g.,
  313. typing @kbd{5 n} or @kbd{5 p} navigates in one step to the item five items lower
  314. or higher than the current one.
  315. Navigation to other types of Todo files is discussed in the relevant
  316. sections below.
  317. @node Editing, Todo Archives, Navigation, Top
  318. @chapter Editing
  319. Editing in Todo mode means making structural or textual changes at one
  320. of the levels of organization (file, category, or item). Structural
  321. editing includes adding, relocating and removing units of information
  322. at a level; textual editing includes renaming files or categories and
  323. changing an item's content or date/time stamp, or adding certain kinds
  324. of marks or tags to items. Todo mode provides commands, detailed in
  325. the following sections, which enable you to quickly and safely make
  326. changes to your todo lists, without having to worry about preserving
  327. the file format.
  328. To save changes you make to the current todo file,
  329. type @kbd{s} (@code{todo-save}). Changes are also saved on quitting
  330. Todo mode with @kbd{q}.
  331. @menu
  332. * File Editing::
  333. * Category Editing::
  334. * Item Editing::
  335. @end menu
  336. @node File Editing, Category Editing, , Editing
  337. @section File Editing and Todo Edit Mode
  338. There are four file-level editing commands:
  339. @table @kbd
  340. @item F a
  341. Add a new todo file (@code{todo-add-file}). This command prompts for
  342. a name and creates the file in @code{todo-directory}, adding the
  343. @samp{.todo} extension (so you should not include the extension in the
  344. name you enter). The command also prompts for the file's first
  345. category and, if option @code{todo-add-item-if-new-category} is
  346. enabled (the default), for that category's first item.
  347. @item F r
  348. Rename the current todo file (@code{todo-rename-file}). If called with
  349. a prefix argument, prompt for a todo file and rename it. If the todo
  350. file has an archive (@pxref{Todo Archive Mode}) or there are
  351. corresponding filtered items files (@pxref{Todo Filtered Items Mode}),
  352. this command renames these accordingly. If there are live buffers
  353. visiting any of these files, the command also renames them accordingly.
  354. @item F k
  355. Delete the current todo file (@code{todo-delete-file}).@footnote{The key
  356. binding of this command is mnemonic for ``kill'' to parallel the binding
  357. @kbd{k} for item deletion, since @kbd{d} is bound to another item
  358. editing command (@pxref{Done Items}).} If the todo file has an archive
  359. (@pxref{Todo Archive Mode}), prompt for whether to delete that as well.
  360. This command also kills the buffers visiting the deleted files.
  361. @item F e
  362. This command (@code{todo-edit-file}) changes the buffer's major mode to
  363. Todo Edit mode. In this mode the entire file is visible, the buffer is
  364. writable and you can use the self-insertion keys and standard Emacs
  365. editing commands to make changes. To return to Todo mode, type @kbd{C-x
  366. C-q} (@code{todo-edit-quit}).
  367. The command @kbd{F e} is not intended for normal editing of items and
  368. categories, as it circumvents the restrictions that Todo imposes to
  369. protect against file format corruption (i.e., all categories, not just
  370. the current one, and all internal formatting are exposed and editable).
  371. It is provided primarily as a convenience for two types of use cases
  372. that are likely to arise infrequently. One is to be able to use
  373. standard Emacs commands like @code{query-replace} to replace a piece of
  374. text that occurs in different categories throughout the file. The other
  375. use case is to recover from a mistake, such as accidentally deleting an
  376. item, since this cannot be undone in Todo mode.
  377. Using @kbd{C-x C-q} to quit Todo Edit mode provides a measure of
  378. safety, since it runs a file format check, signaling an error if the
  379. format has become invalid. However, this check cannot tell if the
  380. number of items or categories changed, which could result in the file
  381. containing inconsistent information (see the cautionary note in
  382. @ref{Reordering Categories}, for more details). Invoking @kbd{F e}
  383. displays a warning to this effect.
  384. @end table
  385. @node Category Editing, Item Editing, File Editing, Editing
  386. @section Category Editing
  387. The following commands are available for editing specifically at the
  388. category level (for two other category-editing commands, which are
  389. extensions of item commands, @pxref{Editing Item Headers and Text}):
  390. @table @kbd
  391. @item C a
  392. Add a new category to the current todo file and make that category
  393. current (@code{todo-add-category}). If called with a prefix argument,
  394. prompt for a file name and add the new category to that file. This
  395. command is similar to using @kbd{j}, but it only accepts category names
  396. that are not the name of an existing category in the file.
  397. @item C r
  398. Rename the current category (@code{todo-rename-category}). If this
  399. category's file has an archive (@pxref{Todo Archive Mode}) with a
  400. corresponding category, rename the category there as well.
  401. @item C m
  402. Move the current category (with all its items) to another todo file
  403. (@code{todo-move-category}). If this category's file has an archive
  404. (@pxref{Todo Archive Mode}) with a corresponding category, this command
  405. also moves that category to the archive file corresponding to the moved
  406. to todo file; if there is no such archive file, the command creates it
  407. and adds the category.
  408. @item C k
  409. Delete the current category (@code{todo-delete-category}).@footnote{This
  410. binding is mnemonic for ``kill'' to parallel the binding @kbd{k} for
  411. item deletion, since @kbd{d} is bound to another item editing command
  412. (@pxref{Done Items}).} To delete a category that contains items, you
  413. have to confirm your intent; if the category is empty, deletion is
  414. immediate.
  415. @item C g
  416. Merge the items of one category into another category, delete the first
  417. category and make the second category current
  418. (@code{todo-merge-category}). If both the first and second categories
  419. also have archived items (@pxref{Todo Archive Mode}), merge the former
  420. to the latter. If only the first category has archived items, rename
  421. the archive category to the merged to category. Minibuffer completion
  422. of the name of the category merged to works as with the navigation
  423. command @kbd{j}, and as with that command, passing a prefix argument,
  424. i.e., typing @kbd{C-u C g}, prompts for a file and confines merging to a
  425. category in that file.
  426. @end table
  427. @node Item Editing, , Category Editing, Editing
  428. @section Item Editing
  429. Todo mode provides commands for adding new items as well as textually
  430. changing, deleting and relocating existing items. The commands and
  431. associated options for adding and editing items, in particular, offer
  432. you a lot of flexibility to fine-tune these operations to your needs.
  433. @menu
  434. * Inserting New Items::
  435. * Editing Item Headers and Text::
  436. * Relocating and Removing Items::
  437. @end menu
  438. @node Inserting New Items, Editing Item Headers and Text, , Item Editing
  439. @subsection Inserting New Items
  440. To add a new todo item to a category, type @kbd{i}, which is bound to
  441. the command @code{todo-insert-item}.
  442. @table @kbd
  443. @item i
  444. This command is the entry point for inserting new items into a
  445. category (@code{todo-insert-item}). It prompts for additional keys
  446. until reaching a complete key sequence, which specifies the insertion
  447. parameters you wish to apply (see below). It then prompts for the
  448. text of the item, which you enter in the minibuffer.@footnote{There
  449. are two insertion parameters that override prompting for and manually
  450. entering the new item's text, see below.} Called with one prefix
  451. argument, it also prompts for a category, and called with two prefix
  452. arguments, it prompts for both a file and a category from that file,
  453. and inserts the item accordingly; category name completion works as
  454. with the navigation command @kbd{j}. Finally, it inserts the item
  455. into the current or selected category of the current or selected todo
  456. file at the position in the list corresponding to the priority you
  457. choose, which also depends on the insertion parameters.
  458. @end table
  459. @noindent
  460. The name of this command reflects the fact that you can insert a new
  461. item into the category at any position, giving each new item any
  462. priority in the list, whereas speaking of adding an item to a category
  463. suggests appending it to the top or bottom.
  464. In addition to its file and category, each newly inserted todo item
  465. has a priority in the category and begins with a header string, which
  466. includes at least the current date in the same format used by
  467. @code{diary-insert-entry} (@pxref{Date Formats,,, emacs}). You can
  468. specify the priority and the content of the header string in two ways.
  469. First, you can set the following item insertion options, which apply
  470. on every invocation of @code{todo-insert-item}.
  471. @itemize @bullet
  472. @item
  473. @code{todo-default-priority} is for automatically assigning a new item
  474. the highest or lowest priority in the category, if you do not
  475. explicitly assign it a priority on invoking @code{todo-insert-item}.
  476. By default, such new items are given highest priority, i.e., inserted
  477. at the top of the list.
  478. @item
  479. @code{todo-always-add-time-string} is for including or omitting the
  480. current time in the new item's header. By default, this time string
  481. is omitted.
  482. @item
  483. @code{todo-include-in-diary} is for specifying whether the item
  484. appears in the Fancy Diary display (when the todo file is included in
  485. the Emacs diary file) by adding or omitting
  486. @code{todo-nondiary-marker}. By default, new todo items are so
  487. marked, thus excluded from the diary.
  488. @item
  489. @code{todo-diary-nonmarking} is for adding or omitting
  490. @code{diary-nonmarking-symbol} to items displayed in the diary, to
  491. control whether they are marked in the calendar (@pxref{Format of
  492. Diary File,,, emacs}). By default, todo items that are diary entries
  493. lack this symbol, thus are marked in the calendar.
  494. @end itemize
  495. Beside setting these options, for more flexibility you can also pass
  496. certain parameters on each invocation of @code{todo-insert-item}.
  497. These parameters concern not only the new item's priority and header,
  498. but also its textual content. You pass these parameters by typing a
  499. sequence of one or more keys after the initial @kbd{i}.
  500. Here is a list of the item insertion parameters together with their
  501. mnemonically associated keys@footnote{The non-mnemonic choice of
  502. @kbd{i} for the parameter @samp{default} is motivated by the
  503. convenience of repeating the @kbd{i} used to invoke
  504. @code{todo-insert-item}.} and descriptions of their effect in
  505. @code{todo-insert-item}:
  506. @enumerate
  507. @item
  508. @samp{default} (@kbd{i}): Prompt for the new item's priority
  509. (a number between 1 and one more than the number of items already in
  510. the category) and add a header string conforming to the values of the
  511. above options.
  512. @samp{copy} (@kbd{p}): Make an exact copy of the item at point,
  513. including its header string, and prompt for its priority. (This is
  514. useful for quickly making a new todo item whose text or header you
  515. want to differ only partly from that of an existing item: after
  516. inserting the copy, you can quickly edit it as needed by using
  517. operations described in the next section.)
  518. @item
  519. @samp{diary} (@kbd{y}): Override the option
  520. @code{todo-include-in-diary}; that is, add @code{todo-nondiary-marker}
  521. if the option is non-@code{nil}, omit this marker if the option is @code{nil}.
  522. @samp{nonmarking} (@kbd{k}): Override the option
  523. @code{todo-diary-nonmarking}; that is, add
  524. @code{diary-nonmarking-symbol} if the option is non-@code{nil}, omit this
  525. symbol if the option is @code{nil}. Since this symbol only applies to diary
  526. items, the new item is automatically marked as such, i.e., lacks
  527. @code{todo-nondiary-marker}.
  528. @item
  529. @samp{calendar} (@kbd{c}): Pop up the Emacs calendar and click a date
  530. in it to use that date in the new todo item's header.
  531. @samp{date} (@kbd{d}): Prompt for entering in the minibuffer
  532. the year, month (with completion) and day number components of the
  533. header.
  534. @samp{dayname} (@kbd{n}): Prompt for entering in the minibuffer
  535. a weekday name as the date header instead of a year-month-day string.
  536. @item
  537. @samp{time} (@kbd{t}): Prompt for entering a time string in
  538. the minibuffer instead of automatically inserting the current time;
  539. however, typing @key{RET} at the prompt enters the current time if
  540. @code{todo-always-add-time-string} is non-@code{nil}, otherwise it enters the
  541. empty string (i.e., no time string).
  542. @item
  543. @samp{here} (@kbd{h}): Insert the new item in the position of
  544. the item at point, pushing that and all lower items in the category
  545. down, i.e., lowering their priority, by one.
  546. @samp{region} (@kbd{r}): Use the text of the selected region as the
  547. text of the new item, and insert this in accordance with the item
  548. insertion options and other parameters passed. If the option
  549. @code{todo-use-only-highlighted-region} is non-@code{nil}, then use the
  550. region only when it is highlighted; otherwise, use the region
  551. regardless of highlighting.
  552. @end enumerate
  553. Note that the parameters are divided into five numbered groups; within
  554. a group, the parameters are mutually exclusive. Hence, to build a
  555. complete insertion operation, you select at most one parameter from at
  556. least one of these groups, by typing the corresponding key. If you
  557. want to apply more than one parameter, you must type the corresponding
  558. keys in the order of the numbered groups, subject to the following
  559. constraints.
  560. The keys of groups 2-4 are continuation keys, that is, each can be
  561. followed by a key from a following group. If you want to finish the
  562. sequence with a continuation key, you must double the final key. For
  563. example, @kbd{i y} is not a complete key sequence; rather, you must
  564. type @kbd{i y y}.
  565. By contrast, the keys of groups 1 and 5 are final keys; for example,
  566. @kbd{i i} and @kbd{i h} are complete sequences. The reason for making
  567. two separate groups of the final keys is that the parameters
  568. @samp{default} and @samp{copy} cannot be combined with any other
  569. parameters, while @samp{here} and @samp{region} can be combined with
  570. any of the parameters from groups 2-4.
  571. To aid you in building item insertion key sequences, when you type an
  572. insertion key, this displays a prompt in the echo area showing pairs
  573. of the remaining possible keys and their associated parameters,
  574. grouped and ordered in accordance with the above list. The initial
  575. prompt, after typing @kbd{i} to invoke @code{todo-insert-item}, looks
  576. like this:
  577. @example
  578. 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 @}
  579. @end example
  580. @noindent If you now type @kbd{y}, the prompt changes to this:
  581. @example
  582. Press a key (so far @kbd{i y}): y=>diary:GO! @{ c=>calendar d=>date n=>dayname @} t=>time @{ h=>here r=>region @}
  583. @end example
  584. @noindent Notice that the pair @samp{k=>nonmarking} is now absent, since it
  585. belongs to the same group as the selected pair @samp{y=>diary}, hence
  586. is no longer available for this sequence. Since @kbd{y} is a
  587. continuation key, it is still available, but now the string
  588. @samp{:GO!} is appended to the pair to remind you that pressing this
  589. key again will complete the sequence.
  590. @c Here are some examples of item insertion command key sequences:
  591. @c @itemize @bullet
  592. @c @item
  593. @c @kbd{i h} inserts a new item at the position of the item at point (pushing
  594. @c the latter down) with a header containing the current date and,
  595. @c depending on the values of the mentioned options, possibly the current
  596. @c time and diary-related markings.
  597. @c @item
  598. @c @kbd{i y h} does the same as the preceding command, except that
  599. @c @code{todo-nondiary-marker} is added if @code{todo-include-in-diary} is
  600. @c non-@code{nil} and omitted if that option is @code{nil}; that is,
  601. @c the diary key @kbd{y} @c overrides the setting of this option.
  602. @c @item
  603. @c @kbd{i y t h} does the same as the preceding command, except that it
  604. @c prompts for a time string instead of automatically inserting the
  605. @c current time; however, typing @key{RET} at the prompt returns the
  606. @c current time if @code{todo-always-add-time-string} is non-@code{nil},
  607. @c otherwise the empty string (i.e., no time string).
  608. @c @item
  609. @c @kbd{i y t t} does the same as the preceding command, except that it
  610. @c prompts for the item's priority and inserts it accordingly.
  611. @c @end itemize
  612. An alternative to the key sequence @kbd{i c c} for choosing the item's
  613. date from the calendar is also available: when point is already on a
  614. date in the calendar, typing @kbd{i t}
  615. (@code{todo-insert-item-from-calendar}) prompts for a new item and its
  616. priority and inserts it in the current category. This command, like
  617. @code{todo-insert-item}, also accepts one or two prefix arguments for
  618. choosing the category via minibuffer completion. Note, however, that
  619. the key sequence @kbd{i t} is not defined in Todo mode but in the
  620. Calendar mode keymap. It is a convenient shortcut if you happen to be
  621. using the calendar when you decide to make a new todo item. (Contrast
  622. this with passing the @samp{calendar} parameter, which pops open the
  623. calendar after you have entered the item's text, and then you can
  624. choose a date from the calendar.)
  625. @node Editing Item Headers and Text, Relocating and Removing Items, Inserting New Items, Item Editing
  626. @subsection Editing Item Headers and Text
  627. To make changes to an existing item's content or header, type @kbd{e},
  628. which is bound to the command @code{todo-edit-item}.
  629. @table @kbd
  630. @item e
  631. This command is the entry point for textually editing existing items
  632. in a category (@code{todo-edit-item}). It prompts for additional keys
  633. until reaching a complete key sequence, which specifies the editing
  634. parameters you wish to apply (see below), and then executes the
  635. editing operation accordingly.
  636. @end table
  637. Here is a list of the item editing parameters together with their
  638. mnemonically associated keys and descriptions of their effect in
  639. @code{todo-edit-item}. The list is divided into three groups, for
  640. reasons explained below.
  641. @enumerate 1
  642. @item
  643. @samp{edit} (@kbd{e}): Edit the text of the current item in the
  644. minibuffer; the item's header is omitted.
  645. @samp{header} (@kbd{h}): Edit the text and header of the current item
  646. in the minibuffer.
  647. @samp{multiline} (@kbd{m}): Edit the text of the current item in a
  648. special buffer in Todo Edit mode. After editing, type @kbd{C-x C-q}
  649. to return to Todo mode.@footnote{This runs a format check to ensure
  650. the item is well-formed. However, unlike the command @kbd{F e}
  651. (@pxref{File Editing}), @kbd{e m} does not expose you to the risk of
  652. putting the file in an inconsistent state, since it puts only the
  653. current item in Todo Edit mode.}
  654. @samp{diary} (@kbd{y}): Change the current item's diary inclusion
  655. status by adding @code{todo-nondiary-marker} if the item lacks this,
  656. or by removing it if present.
  657. @samp{nonmarking} (@kbd{k}): Change the current item's calendar
  658. marking status by adding @code{diary-nonmarking-symbol} if the item
  659. lacks this, or by removing it if present. Since this symbol only
  660. applies to diary items, the item is automatically marked as such,
  661. i.e., if @code{todo-nondiary-marker} is present, it is removed.
  662. @samp{date} (@kbd{d}): Prompt for a final key from the second group
  663. of item editing parameters to edit the current item's date string.
  664. @samp{time} (@kbd{t}): Edit the current item's time string, if
  665. present; otherwise, add one. Typing @key{RET} at the prompt enters
  666. the current time if @code{todo-always-add-time-string} is non-@code{nil},
  667. otherwise it enters the empty string (i.e., no time string).
  668. @end enumerate
  669. @noindent
  670. Editing the text of a lengthy item in the minibuffer can be
  671. inconvenient; therefore, if you type @kbd{e e} or @kbd{e h} on an item
  672. whose text contains more than one logical line, the effect is the same
  673. as if you had typed @kbd{e m}, that is, you switch a special buffer in
  674. Todo Edit mode.
  675. When you pass any of the parameters of the preceding group, except for
  676. the @samp{date} parameter, this completes the item editing invocation
  677. begun by typing @kbd{e}. Pressing @kbd{d} to pass the @samp{date}
  678. parameter, however, prompts you with the following parameters and
  679. their associated keys, and pressing any of these completes the
  680. invocation.
  681. @enumerate 2
  682. @item
  683. @samp{full} (@kbd{f}): Successively prompt for editing the year, month
  684. (with completion) and day number parts of the current item's date
  685. string, and, if the option @code{todo-always-add-time-string} is
  686. non-@code{nil}, also for editing its time string.
  687. @samp{calendar} (@kbd{c}): This pops up the Emacs calendar, and after
  688. you type @key{RET} on a date in the calendar makes that date the
  689. item's date.
  690. @samp{today} (@kbd{a}): Make the item's date today's date.
  691. @samp{dayname} (@kbd{n}): Prompt for a weekday name (with completion)
  692. and make it the item's date header. Note that this replaces an
  693. existing date string, it does not add the day name to the date string.
  694. @samp{year} (@kbd{y}): Edit just the year component of the current
  695. item's date string.
  696. @samp{month} (@kbd{m}): Edit just the month component of the current
  697. item's date string (with completion).
  698. @samp{daynum} (@kbd{d}): Edit just the day number component of the
  699. current item's date string.
  700. @end enumerate
  701. @noindent
  702. With the latter three parameters you can add a positive or negative
  703. numeric prefix argument to the invocation: this increments or
  704. decrements the selected date component by the given number and
  705. automatically adjusts the other date components if necessary. For
  706. example, if the item's date string is ``January 1, 2013'', then typing
  707. @kbd{- 3 e d d} results in ``December 29, 2012''.
  708. The first two groups of parameters apply only to todo items that are
  709. not marked as done (@pxref{Done Items}); the two parameters of the
  710. third group, in contrast, apply only to done todo items. You cannot
  711. edit the text of such items, but you can edit or delete the comment
  712. you may have added on marking the item as done (@pxref{Done Items,
  713. @code{todo-item-done}},), or retroactively add a comment, by passing
  714. either of these parameters.
  715. @enumerate 3
  716. @item
  717. @samp{add/edit comment} (@kbd{c}): Edit the current done item's
  718. comment, if it has one; otherwise, prompt for and add a comment.
  719. @samp{delete comment} (@kbd{d}): Delete the current done item's
  720. comment, if it has one.
  721. @end enumerate
  722. The command @code{todo-edit-item} is sensitive to the distinction
  723. between not done and done todo items. If you type @kbd{e} when point
  724. is on a done item, this displays the following prompt in the echo
  725. area:
  726. @example
  727. Press a key (so far @kbd{e}): c=>add/edit comment d=>delete comment
  728. @end example
  729. @noindent
  730. Only by typing @kbd{c} or @kbd{d} in response to this prompt can you
  731. complete the invocation. In contrast, if you type @kbd{e} when point
  732. is on a non-done todo item, this displays the following prompt in the
  733. echo area, and you can continue or complete the invocation only by
  734. typing one of the listed keys:
  735. @example
  736. Press a key (so far @kbd{e}): e=>edit h=>header m=>multiline y=>diary k=>nonmarking d=>date t=>time
  737. @end example
  738. As noted above, passing the @samp{date} parameter does not complete
  739. the invocation of @code{todo-edit-item}; rather, it displays the
  740. following prompt, and typing any of these keys does complete the
  741. invocation:
  742. @example
  743. Press a key (so far @kbd{e d}): f=>full c=>calendar a=>today n=>dayname y=>year m=>month d=>daynum
  744. @end example
  745. In addition to the item-level invocations @kbd{e y}, to change the
  746. current item's diary inclusion status, and @kbd{e k}, to change the
  747. current item's calendar marking status, Todo mode also has two related
  748. category-level commands:
  749. @table @kbd
  750. @item C e y
  751. @itemx C e k
  752. Add @code{todo-nondiary-marker} and @code{diary-nonmarking-symbol},
  753. respectively, to all todo items in the current category; if invoked with
  754. a prefix argument, these markings are removed from all items in the
  755. category.
  756. @end table
  757. @noindent
  758. Like @kbd{e k}, @kbd{C e k} automatically removes @code{todo-nondiary-marker}
  759. from all items it is present on, since only diary items can bear
  760. @code{diary-nonmarking-symbol}.
  761. Since categories often contain a mix of items marked for diary
  762. inclusion and exclusion, and of the former, a mix of those to be
  763. marked and those not to be marked in the calendar, it is more useful
  764. for these category-level commands, unlike the item-level commands, not
  765. to be toggles, but to have the same effect on all items in the
  766. category, and take a prefix argument to reverse the effect. (If you
  767. really want to toggle the diary-inclusion and calendar-marking status
  768. of all items in the category, you can do this by marking all the items
  769. and then invoking @kbd{e y} or @kbd{e k}, @pxref{Marked Items}).
  770. @node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing
  771. @subsection Relocating and Removing Items
  772. In addition to inserting a new todo item and changing the text or header
  773. of an existing item, you can also move an item to another category
  774. (i.e., recategorize it), change its priority within its category, delete
  775. it from the category and file, or mark it as a ``done'' item, which
  776. removes it from the todo list but does not delete it.
  777. @menu
  778. * Reprioritizing Items::
  779. * Moving and Deleting Items::
  780. * Done Items::
  781. @end menu
  782. @node Reprioritizing Items, Moving and Deleting Items, , Relocating and Removing Items
  783. @subsubsection Reprioritizing Items
  784. There are three ways to change a todo item's priority:
  785. @table @kbd
  786. @item r
  787. Raise the current item's priority by one, exchanging its position in the list
  788. with that of the item directly above it (@code{todo-raise-item-priority}).
  789. @item l
  790. Lower the current item's priority by one, exchanging its position in the list
  791. with that of the item directly below it (@code{todo-lower-item-priority}).
  792. @item #
  793. Prompt for a number and relocate the item to the corresponding
  794. position in the list (@code{todo-set-item-priority}). For example,
  795. entering @kbd{3} at the prompt makes the item the third in the
  796. category, i.e., gives it third highest priority; all lower priority
  797. items are pushed down by one. You can also pass the desired priority
  798. as a numeric prefix argument, e.g., @kbd{3 #} gives the item third
  799. highest priority without prompting. (Prefix arguments have no effect
  800. with @kbd{r} or @kbd{l}.)
  801. @end table
  802. @node Moving and Deleting Items, Done Items, Reprioritizing Items, Relocating and Removing Items
  803. @subsubsection Moving and Deleting Items
  804. You can move an item to another category, thereby recategorizing it:
  805. @table @kbd
  806. @item m
  807. Move the item at point to another category (@code{todo-move-item}).
  808. This prompts for a category to move the item to, displays that category,
  809. prompts for the priority of the moved item in the category moved to and
  810. inserts the item accordingly. Minibuffer completion of the name of the
  811. category moved to works as with the navigation command @kbd{j}, and as
  812. with that command, passing a prefix argument prompts for a file and
  813. moves the item to a category in that file; and if the category name you
  814. enter is new, then you are asked whether to add the category to the
  815. file, and if you affirm, the item is moved to the new category.
  816. @end table
  817. You can delete an item, thereby permanently (and, as far as Todo mode
  818. is concerned, irrevocably) removing it from the todo file:
  819. @table @kbd
  820. @item k
  821. Delete the todo item at point (@code{todo-delete-item}; the binding is
  822. mnemonic for ``kill'', since @kbd{d} is used for marking items as done
  823. (@pxref{Done Items}); but note that @kbd{k} does not put the item into
  824. the kill ring). This command requires confirmation that you want to
  825. delete the item, since you cannot undo the deletion in Todo mode. (You
  826. could use @kbd{F e} to recover the item, but be aware that this would
  827. put the file in an inconsistent state, which you can recover from, but
  828. not without a risk; cf.@: the cautionary note in @ref{Reordering
  829. Categories}.)
  830. @end table
  831. @quotation Note
  832. Todo commands that require user confirmation, such as @kbd{k}, use a
  833. modified form of @code{y-or-n-p}, which by default only accepts @kbd{y}
  834. or @kbd{Y}, but not @key{SPC}, as an affirmative answer. This is to
  835. diminish the risk of unintentionally executing the command, which is
  836. especially important with commands that do deletion, since there is no
  837. Todo command to undo a deletion. If you want to be able to use @key{SPC} for
  838. confirmation, enable the option @code{todo-y-with-space}.
  839. @end quotation
  840. @node Done Items, , Moving and Deleting Items, Relocating and Removing Items
  841. @subsubsection Done Items
  842. When the activity or thing that a todo item is about has been done, it
  843. is natural to eliminate the item from the todo list. But instead of
  844. deleting it permanently, you may prefer to keep a record of your
  845. accomplishments by marking the item as done. In Todo mode, this removes
  846. the done item from the todo list, so as not to clutter it up, and stores
  847. it elsewhere. Such stored items form a record or diary of things done.
  848. The Todo package provides two such stores: the ``done items'' section of
  849. a Todo category, described here, and done item archives (@pxref{Todo
  850. Archive Mode}).
  851. @table @kbd
  852. @anchor{todo-item-done}
  853. @item d
  854. This command (@code{todo-item-done}) removes the todo item at point
  855. from the todo list, appends to the original header a header consisting
  856. of @code{todo-done-string} (by default @samp{DONE }) and the current
  857. date, and if @code{todo-always-add-time-string} is enabled, also the
  858. current time, and adds the resulting done item to the top of the done
  859. items section of the category. Invoked with a prefix argument, it
  860. also prompts you to enter a comment, which is appended to the end of
  861. the done item, prefixed with @code{todo-comment-string} (by default
  862. @samp{COMMENT: }).
  863. @end table
  864. A category's done items section is located below the last todo (i.e.,
  865. not done) item in the category. By default this section is hidden from
  866. view. There are two commands for viewing and hiding done items; since
  867. these are toggle commands, for convenience they also have a single key
  868. binding:
  869. @table @kbd
  870. @item C v
  871. @itemx v
  872. Make the done items section of the current category visible if it is
  873. hidden, or hide it if it is visible
  874. (@code{todo-toggle-view-done-items}). If you always want to see the
  875. done items section on entering a category, enable the option
  876. @code{todo-show-with-done}; you can still use @kbd{C v} or @kbd{v} to
  877. hide (and unhide) it.
  878. @item F V
  879. @itemx V
  880. Toggle the standard category display in the current todo file, i.e.,
  881. display only the done items section of each category in the file, or if
  882. this is visible, hide it again and display only the todo items section
  883. (@code{todo-toggle-view-done-only}).
  884. @end table
  885. Since done items are meant to be a record of your finished todo items,
  886. you cannot apply to them the same kinds of editing operations
  887. available to unfinished todo items. However, as explained in
  888. @ref{Editing Item Headers and Text} and repeated below for
  889. convenience, you can edit or delete a done item's comment, or
  890. retroactively add a comment. You can also relocate a done item, and
  891. you can revert its done status, making it an unfinished item again.
  892. @table @kbd
  893. @item e c
  894. Edit the current done item's comment, if it has one; otherwise, prompt
  895. for and add a comment.
  896. @item e d
  897. Delete the current done item's comment, if it has one.
  898. @item m
  899. Move the done item at point to the top of the done items section of
  900. another category (@code{todo-move-item}). This is useful in case,
  901. after having finished a todo item and relocated it to its category's
  902. done items section, you create a category that is better suited to the
  903. content of the done item than its current category; in other words,
  904. you can retroactively recategorize the done item.
  905. @item u
  906. If you decide the done item at point is not done after all, this command
  907. ``undoes'' it, i.e., restores it to the todo list of its category, with
  908. the priority you choose for it (@code{todo-item-undone}). If the done
  909. item has a comment, you are asked whether to delete it from the restored
  910. item.
  911. @end table
  912. @node Todo Archives, Marked Items, Editing, Top
  913. @chapter Todo Archives
  914. When the done items section of a category itself starts to become
  915. cluttered, or if you just want to store some accomplished todo items in
  916. a separate file, you can move them to a Todo archive. This is a file
  917. with exactly the same structure as a todo file, i.e., divided into
  918. categories, but differs in that the categories contain only done items.
  919. Todo archives reside, like todo files, in @code{todo-directory} but have
  920. the extension @samp{.toda} instead of @samp{.todo}.
  921. @menu
  922. * Creating and Visiting Archives::
  923. * Todo Archive Mode::
  924. @end menu
  925. @node Creating and Visiting Archives, Todo Archive Mode, , Todo Archives
  926. @section Creating and Visiting Archives
  927. Todo mode provides the following command for archiving items:
  928. @table @kbd
  929. @item A d
  930. This command (@code{todo-archive-done-item}) archives the done item at point.
  931. Invoked with a prefix argument, it archives all done items in the
  932. current todo category. If an archive for the current todo file
  933. already exists and contains a category with the same name as the
  934. current todo category, then this command moves the done item to the
  935. top of the corresponding archive category. If the archive exists but
  936. it does not have a corresponding category, this command creates the
  937. category in the archive and moves the done item to it. If no archive
  938. for the todo file exists, the command creates both the archive file,
  939. using the same base name as that of the todo file, as well as the
  940. category, and moves the done item to it.
  941. @end table
  942. Typing @kbd{A d} is also the only way within the Todo mode package to
  943. create an archive file and its categories. Consequently, as a rule each
  944. archive file corresponds to exactly one todo file and has the same base
  945. name as this file, and each category in an archive file corresponds to
  946. and has the same name as a category in the corresponding todo file.
  947. Exceptions can only arise if you delete a todo file but not the
  948. corresponding archive, or if you delete a category in a todo file that
  949. has a corresponding category in an archive.
  950. You might be inclined to do the latter if you have archived all the
  951. items from a given todo category and you don't plan to add new items to
  952. it. In particular, if you have numerous such empty categories in a todo
  953. file, this can make sequential navigation in the file annoying. You can
  954. avoid this annoyance by deleting these categories, but only at the cost
  955. of putting the todo file out of synch with the archive file.
  956. You may find it preferable not to delete empty todo categories but to
  957. enable the option @code{todo-skip-archived-categories}. When this is
  958. non-@code{nil}, such empty todo categories are skipped over by the sequential
  959. category navigation commands @kbd{f} and @kbd{b}, so they don't distract you
  960. while navigating and you maintain the structural correspondence between
  961. todo and archive files (you can also still jump to empty todo categories
  962. with @kbd{j}).
  963. If you rename a todo category that has a corresponding category in an
  964. archive, the archive category is also automatically identically renamed.
  965. Likewise, if you move such a todo category to another file; in this
  966. case, if there is no archive file corresponding to the todo file the
  967. category is moved to, then the archive is automatically created and the
  968. archived category is moved to it.
  969. There are two commands in Todo mode for visiting archive files:
  970. @table @kbd
  971. @item A f
  972. Switch to a buffer displaying the archived category corresponding to the
  973. current todo category (@code{todo-find-archive}). If the todo category
  974. has no archived items, the command asks if you want to visit the archive
  975. anyway. If there is no archive for this todo file, it asks if you want
  976. to visit another archive, which you can select via minibuffer
  977. completion.
  978. @item A c
  979. Choose an archive to visit, whether or not the current todo file has an
  980. archive (@code{todo-choose-archive}).
  981. @end table
  982. As with todo files, you can also visit a Todo archive by invoking a
  983. standard Emacs file-visiting command; this displays the first (on the
  984. initial invocation) or current category of the archive.
  985. @node Todo Archive Mode, , Creating and Visiting Archives, Todo Archives
  986. @section Todo Archive Mode
  987. When you visit a Todo archive, the buffer is in Todo Archive mode. It
  988. displays categories just as in Todo mode, except that they only contain
  989. done items. It provides the same sequential navigation commands as
  990. Todo mode: @kbd{f} and @kbd{b} navigate between the categories of the current
  991. archive, and @kbd{n} and @kbd{p} navigate between the done items of the current
  992. archive category.
  993. The commands @kbd{t} and @kbd{j} are also available in Todo Archive
  994. mode, and they work the same as in Todo mode, which means they can only
  995. be used to return to Todo mode: @kbd{t} prompt for and switch to a todo
  996. file, and with @kbd{j} you can only jump to a todo category. These
  997. commands exclude archives because an archive file has the same base name
  998. as the corresponding todo file, and category name completion uses only
  999. the base names, so the commands cannot know which type of file you want
  1000. to visit. For this reason, there is a special command in Todo Archive
  1001. mode for jumping to another archive category or visiting another archive
  1002. file:
  1003. @table @kbd
  1004. @item a
  1005. This command (@code{todo-jump-to-archive-category}) prompts for a category in the
  1006. current archive and jumps to it. Called with a prefix argument, it
  1007. prompts for another archive, then for a category in it and jumps to
  1008. that category.
  1009. @end table
  1010. None of the Todo mode editing commands are available in Todo Archive
  1011. mode, since archives are meant to be static records of accomplished todo
  1012. items. Should you, however, archive an item by mistake or simply change
  1013. your mind about the archival status of an item, you can ``unarchive'' it:
  1014. @table @kbd
  1015. @item u
  1016. Restore the done item at point to the top of the done items section of
  1017. the corresponding category in the corresponding todo file, i.e., an
  1018. unarchived item remains a done item (@code{todo-unarchive-items}). When
  1019. the last item in an archive category has been unarchived, the category
  1020. is automatically deleted from the archive. If this was the only
  1021. category in the archive, the archive file is also automatically deleted.
  1022. @end table
  1023. Since it is natural to visit an archive from the corresponding todo
  1024. file, it would be convenient to easily return to the todo file when you
  1025. have finished browsing the archive. If you type @kbd{q} to quit Todo
  1026. Archive mode, this switches to the corresponding todo file and shows the
  1027. todo category corresponding to the archive category you were just
  1028. visiting.
  1029. The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
  1030. Archive mode. It deletes the current archive file and prompts you
  1031. whether to delete the corresponding todo file.
  1032. @node Marked Items, Todo Categories Mode, Todo Archives, Top
  1033. @chapter Marked Items
  1034. For many item editing commands it can make sense and be convenient to
  1035. apply them simultaneously to more than one item in the current category.
  1036. Todo facilitates this by means of marked items.
  1037. @table @kbd
  1038. @item *
  1039. Mark the item at point if it is unmarked, and remove the mark it is
  1040. already marked (@code{todo-toggle-mark-item}). The mark is a string
  1041. specified by the option @code{todo-item-mark} (by default @samp{*})
  1042. appended in front of the item header (more precisely, in front of the
  1043. item's priority number or prefix; see @ref{Todo Display Features}, for
  1044. details of the latter). After marking the current item, the command
  1045. advances point to the next item. It also accepts a numeric prefix
  1046. argument, which allows toggling the mark of multiple consecutive items.
  1047. @item C *
  1048. Mark all todo items in the current category.
  1049. @item C u
  1050. Unmark all todo item in the current category.
  1051. @end table
  1052. You can also use the last two commands to mark or unmark all done items in
  1053. the category, but only when only the done items section is being
  1054. displayed, i.e., after invoking @kbd{C V} or @kbd{V}.
  1055. The following commands operate on marked items:
  1056. @itemize @bullet
  1057. @item
  1058. @kbd{k} (deleting)
  1059. @item
  1060. @kbd{m} (moving to another category)
  1061. @item
  1062. @kbd{d} (moving to the done items section; note that @kbd{C-u d} adds
  1063. the same comment to all marked items)
  1064. @item
  1065. @kbd{A d} (archiving)
  1066. @item
  1067. @kbd{u} (both in Todo mode for undoing a done item and in Todo Archive
  1068. mode for unarchiving an item)
  1069. @item
  1070. the commands for editing the item header (those beginning with the
  1071. prefix @kbd{e d} as well as @kbd{e t}, @kbd{e y} and @kbd{e k})
  1072. @end itemize
  1073. @noindent
  1074. The item insertion, textual editing and priority changing commands do
  1075. not operate on marked items.
  1076. If you use @kbd{m}, @kbd{d}, @kbd{A d} or @kbd{u} on multiple
  1077. noncontiguous marked items, the relocated items retain their relative
  1078. order but are now listed consecutively en bloc.
  1079. You can mark both todo and done items, but note that only @kbd{m} and
  1080. @kbd{k} can apply to both; other commands only affect either marked
  1081. todo or marked done items, so if both types of items are marked,
  1082. invoking these commands has no effect and informs you of your
  1083. erroneous attempt.
  1084. @node Todo Categories Mode, Searching for Items, Marked Items, Top
  1085. @chapter Todo Categories Mode
  1086. It can be helpful to have a compact overview of the categories in a
  1087. todo file and the types of items it contains; the Todo package
  1088. provides a tabular view of this information.
  1089. @table @kbd
  1090. @item F c
  1091. Typing this command (@code{todo-show-categories-table}) in Todo mode or Todo
  1092. Archive mode switches to a buffer displaying a table that gives an
  1093. overview of the categories in the current todo or archive file. This
  1094. buffer is in Todo Categories mode.
  1095. @end table
  1096. The table consists of a column containing the names of the categories in
  1097. the file, followed by columns containing counts of certain types of
  1098. items in each category. With todo files there are four count types: all
  1099. todo (i.e., not done) items, diary items (i.e., those todo items lacking
  1100. the @code{todo-nondiary-marker}, which hence can appear in the Fancy Diary
  1101. display), done (but not archived) items, and archived items. With
  1102. archive files all items are done, so the table only has a column for
  1103. this count. The final row of the table gives total item counts across
  1104. all categories in the file.
  1105. Aside from explicitly invoking @kbd{F c} to display the table of
  1106. categories, you can also arrange to have it displayed on the first
  1107. invocation of @code{todo-show} for a given file (i.e., either using
  1108. @code{todo-show} to initiate a Todo session, or calling it in Todo mode
  1109. to visit another todo file). To do this customize the option
  1110. @code{todo-show-first}.
  1111. @menu
  1112. * Table of Item Counts::
  1113. * Reordering Categories::
  1114. @end menu
  1115. @node Table of Item Counts, Reordering Categories, , Todo Categories Mode
  1116. @section Table of Item Counts
  1117. Above each column of the table is a labeled button you can press by
  1118. clicking with the mouse or by typing @key{RET} on it. Pressing an item
  1119. count button sorts the table alternately in ascending or descending
  1120. order according to the type of count. Pressing the category button
  1121. alternates between the initial numerical order of the categories and
  1122. alphabetical order. In numerical order the column of category names is
  1123. preceded by a column containing the corresponding category numbers; this
  1124. column is not displayed in the alphabetical listing. Instead of
  1125. pressing the buttons, you can also sort the table by typing the
  1126. following keys:
  1127. @itemize
  1128. @item @kbd{c}
  1129. to sort by category numerically or alphabetically;
  1130. @item @kbd{t}
  1131. to sort by todo item counts;
  1132. @item @kbd{y}
  1133. to sort by diary item counts;
  1134. @item @kbd{d}
  1135. to sort by done item counts;
  1136. @item @kbd{a}
  1137. to sort by archived item counts.
  1138. @end itemize
  1139. Each row of the table is also buttonized; pressing one of these exits
  1140. the buffer (killing it), returns to the buffer of the file from which
  1141. you had invoked @kbd{F c}, and displays the category that was named in
  1142. the row button you pressed (i.e., pressing this button jumps to that
  1143. category). However, if the category named in the row is in a todo
  1144. file and all of its items have been archived, and you have enabled the
  1145. option @code{todo-skip-archived-categories}, then pressing the button
  1146. jumps to the archive category instead of the empty todo category. You
  1147. can recognize such categories by their items counts in the table---all
  1148. columns but the archived one have counts of zero---and in addition,
  1149. their lines in the table are also distinguished from the others by a
  1150. different face (@pxref{Faces}).
  1151. You can navigate around the table:
  1152. @table @kbd
  1153. @item n
  1154. @itemx @key{TAB}
  1155. Advance point to the next button.
  1156. @item p
  1157. @itemx S-@key{TAB}
  1158. Put point on the previous button.
  1159. @end table
  1160. These commands are cyclic, e.g., when point is on the last button,
  1161. pressing @kbd{n} moves it to the first button.
  1162. Typing @kbd{q} exits Todo Categories mode, killing the buffer and returning
  1163. to the current category in the Todo mode or Todo Archive mode buffer
  1164. from which you had invoked @kbd{F c}.
  1165. @node Reordering Categories, , Table of Item Counts, Todo Categories Mode
  1166. @section Reordering Categories
  1167. Todo Categories mode provide commands with which you can change the
  1168. numbering of the categories in the current file. This renumbering has
  1169. the effect of reordering the categories for sequential navigation by
  1170. @kbd{f} and @kbd{b} in Todo mode and Todo Archive mode. These commands
  1171. are only operative when the table displays the categories in their
  1172. numerical order. They work just like reprioritizing items in Todo mode,
  1173. hence have the same key bindings:
  1174. @table @kbd
  1175. @item r
  1176. Raise the current line of the table (the one the cursor is on),
  1177. decreasing the category's number by one (@code{todo-raise-category}).
  1178. This command exchanges lines, and hence the numbers, of the category at
  1179. point and the one above it before invoking the command.
  1180. @item l
  1181. Lower the current line of the table, increasing the category's number by
  1182. one (@code{todo-lower-category}). This command exchanges lines, and
  1183. hence the numbers, of the category at point and the one below it before
  1184. invoking the command.
  1185. @item #
  1186. Prompt for a number between 1 and the number of categories in the file
  1187. and reorder the table accordingly (@code{todo-set-category-number}). If
  1188. called with a numeric prefix argument within the allowed range, reorder
  1189. the table without prompting.
  1190. @end table
  1191. The reordering done by these commands remains in effect when you return
  1192. to Todo mode or Todo Archive mode and, as long as you save the todo
  1193. or archive file after reordering, in subsequent sessions as well.
  1194. @quotation @strong{Caution}
  1195. It is important to be aware that renumbering the categories does not
  1196. change the textual order of the categories in the file. This is
  1197. significant if you should invoke @kbd{F e} to edit the entire file
  1198. manually and in so doing alter the number of categories or the number
  1199. of items in a category: this will make the information shown in the
  1200. table of categories of this file inconsistent with its actual state.
  1201. You can repair this inconsistency by invoking the command
  1202. @code{todo-repair-categories-sexp} (which lacks a key binding, since
  1203. it is meant to be a rarely needed rescue operation). But this will
  1204. revert any renumbering of the categories you have made, so you will
  1205. have to renumber them again. This is one reason why you should
  1206. exercise caution when using @kbd{F e}.
  1207. @end quotation
  1208. @node Searching for Items, Todo Filtered Items Mode, Todo Categories Mode, Top
  1209. @chapter Searching for Items
  1210. It can be useful to be able to locate and examine all todo items that
  1211. fit certain criteria, regardless of which category they belong to. One
  1212. way to do this in Todo mode is by sequentially searching in the file:
  1213. @table @kbd
  1214. @item S
  1215. This command (@code{todo-search}; the key is capital @kbd{S}) prompts for a
  1216. regular expression, searches from the beginning of the current todo file
  1217. and displays the category containing the first match it finds, with the
  1218. match highlighted. If there are further matches, a message saying how
  1219. many are left is displayed and you are asked if you want to go to the
  1220. next match. When you reach the last match, or if you decide not to go
  1221. to further matches, you are asked whether the match highlighting should
  1222. be removed.
  1223. @item X
  1224. This command (@code{todo-clear-matches}) removes any highlighting added by @kbd{S}.
  1225. This is so you can leave the matches highlighted at the end of the
  1226. search and remove the highlighting later.
  1227. @end table
  1228. These commands are also available in Todo Archive mode.
  1229. @node Todo Filtered Items Mode, Todo Display Features, Searching for Items, Top
  1230. @chapter Todo Filtered Items Mode
  1231. A more powerful alternative to sequential searching is item filtering,
  1232. by which items from different categories that match specified criteria
  1233. are gathered and displayed in a new buffer as a kind of virtual
  1234. category in a distinct mode, Todo Filtered Items mode.
  1235. @menu
  1236. * Filtering Items::
  1237. * Todo Filtered Items Mode Commands::
  1238. * Files of Filtered Items::
  1239. @end menu
  1240. @node Filtering Items, Todo Filtered Items Mode Commands, , Todo Filtered Items Mode
  1241. @section Filtering Items
  1242. Todo mode provides three ways to filter items: a general filter for
  1243. items matching a user-entered regular expression, as with the search
  1244. command; and two specific filters, one for diary-displayable items
  1245. (i.e., those lacking @code{todo-nondiary-marker}) and one for top
  1246. priority items (more on the latter below). The commands for each
  1247. filter come in pairs, one for filtering just the current todo file and
  1248. one for filtering a user-specified list of todo files. Thus, there
  1249. are six item filtering commands:@footnote{The use of @kbd{F} in the key
  1250. sequences of these commands naturally recalls ``filter'', but is also
  1251. consistent with the Todo mode mnemonic key binding convention, since the
  1252. commands involve one or more whole files.}
  1253. @itemize @bullet
  1254. @item
  1255. @kbd{F x x} (@code{todo-filter-regexp-items})
  1256. @item
  1257. @kbd{F x m} (@code{todo-filter-regexp-items-multifile})
  1258. @item
  1259. @kbd{F y y} (@code{todo-filter-diary-items})
  1260. @item
  1261. @kbd{F y m} (@code{todo-filter-diary-items-multifile})
  1262. @item
  1263. @kbd{F t t} (@code{todo-filter-top-priorities})
  1264. @item
  1265. @kbd{F t m} (@code{todo-filter-top-priorities-multifile})
  1266. @end itemize
  1267. There are two ways to specify which files the multifile filtering
  1268. commands apply to. If there are files you want to filter every time you
  1269. use these commands, customize the option @code{todo-filter-files}. If you
  1270. leave this option empty (the default), invoking a multifile filtering
  1271. command pops up a buffer similar to the Customization buffer for
  1272. @code{todo-filter-files}, in which you can select files to filter just for
  1273. this invocation.
  1274. Diary and top priority items are by definition non-done todo items, but
  1275. when filtering by regular expression, you can extend the scope of the
  1276. command to done items by enabling the option @code{todo-filter-done-items}.
  1277. Then @kbd{F x x} and @kbd{F x m} will gather both matching todo and matching
  1278. done items (including done items from any archive files corresponding to
  1279. the selected todo files) into the virtual category of filtered items.
  1280. There are several ways to specify how many items in each category count
  1281. as top priorities and hence get filtered by @kbd{F t t} and @kbd{F t m}:
  1282. @itemize @bullet
  1283. @item
  1284. The option @code{todo-top-priorities} specifies a single default number
  1285. for all categories and all todo files; its default value is 1, which
  1286. means just the highest priority item in every category is filtered,
  1287. unless otherwise specified.
  1288. @item
  1289. The option @code{todo-top-priorities-overrides} lists file-wide overrides
  1290. of @code{todo-top-priorities} as well as category-specific overrides. It
  1291. is empty by default. However, using the Custom facility to set this
  1292. option would be tedious and error-prone, so instead you should use the
  1293. commands @kbd{F t s} and @kbd{C t s}. The former sets (i.e., overrides) the
  1294. default number of top priorities for all categories in the current
  1295. todo file, and the latter sets the number of top priorities for the
  1296. current category. To exclude a category or file from filtering by @kbd{F t t}
  1297. and @kbd{F t m}, set the number to @samp{0}.
  1298. @item
  1299. You can invoke @kbd{F t t} and @kbd{F t m} with a numeric prefix argument,
  1300. which specifies the number of top priorities in each category just for
  1301. this invocation, overriding both @code{todo-top-priorities-overrides} and
  1302. @code{todo-top-priorities}.
  1303. @end itemize
  1304. @node Todo Filtered Items Mode Commands, Files of Filtered Items, Filtering Items, Todo Filtered Items Mode
  1305. @section Todo Filtered Items Mode Commands
  1306. The output of the item filtering commands looks similar to a regular
  1307. Todo category, but it is not contained in any todo file and does not
  1308. have a name on being created, so it is not a ``real'' category but a
  1309. ``virtual'' category. Another difference is the lack of a done items
  1310. section; either there are no done items in the list (when the filtered
  1311. items are diary or top priority items), or these are displayed in the
  1312. same list as todo items (if you filtered by regular expression and
  1313. allowed done items). A further difference is that the items have an
  1314. additional header, between the item's date/time header and its text,
  1315. specifying which category (and if you invoked a multifile command, also
  1316. which file) the item comes from, and if you filtered by regular
  1317. expression, also whether the item comes from a Todo archive.
  1318. The sequential item navigation commands @kbd{n} and @kbd{p} work the same in
  1319. Todo Filtered Items mode as in Todo mode, as do the file and category
  1320. jumping commands @kbd{t} and @kbd{j}; however, the sequential category
  1321. navigation commands are unavailable, since virtual categories of
  1322. filtered items are not ordered with respect to ``real'' categories. In
  1323. addition, Todo Filtered Items mode provides a special navigation
  1324. command:
  1325. @table @kbd
  1326. @item g
  1327. @itemx @key{RET}
  1328. If you type this command (@code{todo-go-to-source-item}) with point on a
  1329. filtered item, the buffer switches to the item's source file (in Todo
  1330. mode or Todo Archive mode, as the case may be) and displays its
  1331. category, with point on the item.
  1332. @end table
  1333. Filtered items cannot be textually edited, moved to another category,
  1334. marked done or archived like items in a real todo category, since these
  1335. would then be out of synch with each other. But there is one type of
  1336. editing command that does work in Todo Filtered Items mode: changing an
  1337. item's priority:
  1338. @table @kbd
  1339. @item r
  1340. @itemx l
  1341. @itemx #
  1342. These commands raise, lower, or set, respectively, the current item's
  1343. priority in the virtual category.
  1344. @end table
  1345. @noindent
  1346. Using these commands, you can create a cross-category (and even
  1347. cross-file) prioritized list of filtered items. However, there is a
  1348. restriction on these commands in Todo Filtered Items mode: you cannot
  1349. change the relative priorities of items from the same real category,
  1350. since that would make the filtered list inconsistent with the source
  1351. todo list.
  1352. @node Files of Filtered Items, , Todo Filtered Items Mode Commands, Todo Filtered Items Mode
  1353. @section Files of Filtered Items
  1354. Typing @kbd{s} in Todo Filtered Items mode saves the buffer of filtered
  1355. items to a file in @code{todo-directory}. Files of items filtered by
  1356. regular expression have the extension @samp{.todr}, those with filtered
  1357. diary items have the extension @samp{.tody} and those with filtered top
  1358. priorities have the extension @samp{.todt}. The extensions are added
  1359. automatically the first time you save the buffer to a file.
  1360. With filtered top priority or diary items, the file is automatically
  1361. named on first saving it, using as the base name either the same base
  1362. name as the single todo file it was generated from, or combining the
  1363. base names of the todo files used in multifile filtering commands.
  1364. With items filtered by regular expression, it can be useful to save
  1365. separate lists generated from the same file(s) using different regular
  1366. expressions, so when saving such a list, you are prompted for a short
  1367. identifying string to add to the file name.
  1368. When you invoke one of the item filtering commands without a prefix
  1369. argument and a corresponding file already exists, the command visits
  1370. this file (if, for the current file or chosen files, there are multiple
  1371. files of items filtered by regular expression, you are prompted to
  1372. choose one). To force generation of a new filtered list, invoke the
  1373. command with a prefix argument (in the case of top priority items,
  1374. either numeric as described above, or the raw prefix argument @kbd{C-u} to
  1375. use the values of @code{todo-top-priorities-overrides} or
  1376. @code{todo-top-priorities}).
  1377. Aside from explicitly invoking an item filtering command to display a
  1378. saved list of items filtered by a given method from given todo files,
  1379. there are two other ways to visit a saved file of filtered items. You
  1380. can invoke a command similar to @code{find-file}:
  1381. @table @kbd
  1382. @item F f
  1383. Visit a saved file of filtered items, which you choose via minibuffer
  1384. completion (@code{todo-find-filtered-items-file}).
  1385. @end table
  1386. @noindent
  1387. Alternatively, as with tables of categories, by customizing
  1388. @code{todo-show-first} you can have the first invocation of
  1389. @code{todo-show} for a given todo file display the corresponding saved
  1390. file of filtered items. If there is no saved filtered items list for
  1391. the file, @code{todo-show} simply defaults to visiting the file and
  1392. displaying its first category, as usual.
  1393. The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
  1394. Filtered Items mode. It deletes the current filtered items file.
  1395. @node Todo Display Features, Printing Todo Buffers, Todo Filtered Items Mode, Top
  1396. @chapter Todo Display Features
  1397. You can change the appearance of Todo mode buffers in a variety of ways.
  1398. @menu
  1399. * Faces::
  1400. * Item Prefix::
  1401. * Other Display Commands and Options::
  1402. @end menu
  1403. @node Faces, Item Prefix, , Todo Display Features
  1404. @section Faces
  1405. Each of the Todo modes uses faces to distinguish various aspects of
  1406. the display, both structural and informational. For example, the
  1407. faces for the date and time strings of todo item headers
  1408. (@code{todo-date} and @code{todo-time}, respectively) by default
  1409. inherit the attributes of the corresponding faces used by the Emacs
  1410. diary; but when the date and time of a Todo diary item (i.e., an item
  1411. lacking @code{todo-nondiary-marker}) is earlier than the current date
  1412. and time, they are displayed in a different face
  1413. (@code{todo-diary-expired}). In this way, you can readily recognize
  1414. diary items that have ``expired'' and act accordingly (e.g., by
  1415. tagging them as done or by updating the deadlines).
  1416. Another example of an informational face is the face used to
  1417. distinguish top priority items (@code{todo-top-priority}). A third
  1418. case is the face used in Todo Categories mode to mark rows of the
  1419. table containing categories with only archived items
  1420. (@code{todo-archived-only}).
  1421. The @code{todo-faces} customization group contains a complete list of
  1422. Todo mode faces and brief descriptions of their use.
  1423. @node Item Prefix, Other Display Commands and Options, Faces, Todo Display Features
  1424. @section Item Prefix
  1425. In the default display of (real or virtual) categories in Todo mode,
  1426. Todo Archive mode and Todo Filtered Item mode the items are visually
  1427. numbered in ascending order, starting with @samp{1} on the top item,
  1428. displayed to the left of its header (date/time string). With todo items
  1429. the numbers indicate each item's priority in the list, so when you
  1430. reprioritize an item with @kbd{#} or move it with @kbd{m}, these numbers make
  1431. it easier to choose the item's new priority. The numbering also lets
  1432. you to see at a glance how many items there are in the list. When an
  1433. item is inserted, deleted, or moved, the numbering is automatically
  1434. updated. In Todo mode, the todo and done items sections in each
  1435. category are separately numbered.
  1436. If you prefer not to have item numbering displayed, disable the option
  1437. @code{todo-number-prefix}; then the display of each item starts by default
  1438. simply with its header. But you can also replace the numbering with a
  1439. visually distinctive string of your choice by customizing the option
  1440. @code{todo-prefix} (the empty string by default). Another alternative is to
  1441. temporarily hide the item numbering:
  1442. @table @kbd
  1443. @item F N
  1444. @itemx N
  1445. Toggle between displaying item numbering and displaying the
  1446. @code{todo-prefix} string in the current Todo file (todo, archive, or
  1447. saved virtual category of filtered items). (This command also works in
  1448. buffers of filtered items that have not yet been written to a file.)
  1449. @end table
  1450. In the todo items section of each Todo mode category, the item prefix
  1451. (whether a priority number or a fixed string) of the top priority
  1452. items (determined as specified in @pxref{Filtering Items}) is
  1453. displayed in a face (@code{todo-top-priority}) different from the face
  1454. of the prefix of non-top-priority items, so you see at a glance how
  1455. many items in the category are top priorities.
  1456. @node Other Display Commands and Options, , Item Prefix, Todo Display Features
  1457. @section Other Display Commands and Options
  1458. There are two additional toggle commands that affect display in the
  1459. current file:
  1460. @table @kbd
  1461. @item F h
  1462. @itemx h
  1463. Hide the item headers if visible, or show them if they are hidden.
  1464. With done items, only the done header (i.e., the done tag and date-time
  1465. string inserted when the item was marked done) is hidden, the original
  1466. date-time string is not. With filtered items, the category (or
  1467. category-file) tag is not hidden.
  1468. @item F H
  1469. @itemx H
  1470. Highlight the current item (with the face @code{hl-line}) if
  1471. unhighlighted, or remove its highlighting. When item highlighting is
  1472. enabled, it follows navigation by @kbd{n} or @kbd{p}. If you want to
  1473. have current item highlighting by default, enable the option
  1474. @code{todo-highlight-item}. @kbd{F H} or @kbd{H} will still toggle
  1475. it.
  1476. @end table
  1477. There are two options which affect the display of items whose content is
  1478. longer than one screen line:
  1479. @itemize @bullet{}
  1480. @item
  1481. @code{todo-indent-to-here} sets the amount of indentation for all lines
  1482. after the first in multiline todo items, which is necessary in order
  1483. for todo diary items to be fully visible in the Fancy Diary display.
  1484. The default indentation is 3 spaces. For a uniform appearance this
  1485. option applies to all items, i.e., diary and nondiary todo items and
  1486. also done items.
  1487. @item
  1488. @code{todo-wrap-lines} allows you to choose, for the purposes of
  1489. insertion and editing, between treating multiline todo items as
  1490. containing multiple logical lines with hard line breaks or as multiple
  1491. visual lines using Visual Line mode; the latter is the default. Since
  1492. multiparagraph items also contain hard line breaks in Visual Line mode,
  1493. for a uniform appearance this display shows indentation on wrapped lines
  1494. by using a wrap-prefix of @code{todo-indent-to-here} spaces.
  1495. @end itemize
  1496. The indentation inserted after a hard newline is actually a tab
  1497. character, and the Todo modes that display items bind @code{tab-width} to
  1498. @code{todo-indent-to-here}, so if you change the default value of the
  1499. latter, the next time you visit a Todo file, the indentation will
  1500. reflect your change.
  1501. By default, the todo and done items sections of a todo category are
  1502. visually separated by a line as wide as the window the buffer is
  1503. displayed in. You can change the appearance and width of the separator
  1504. by customizing @code{todo-done-separator-string}; you can also change the
  1505. face of the separator string (@code{todo-done-sep}).
  1506. There are also several options for changing the appearance in Todo
  1507. Categories mode and Todo Filtered Items mode, beyond those mentioned
  1508. above in the sections on these modes; see the customization groups
  1509. @code{todo-categories} and @code{todo-filtered} for details.
  1510. @node Printing Todo Buffers, Legacy Todo Mode Files, Todo Display Features, Top
  1511. @chapter Printing Todo Buffers
  1512. If you print a Todo buffer using one of the standard Emacs printing
  1513. commands, it does not look exactly like what you see in the buffer.
  1514. This is because some of the display features are non-printable
  1515. (specifically, those using overlays, word-wrap and wrap-prefix). Todo
  1516. mode provides two print commands that produce output which includes
  1517. printable counterparts of such display features:
  1518. @table @kbd
  1519. @item P B
  1520. Send the printable buffer output directly to your printer.
  1521. @item P F
  1522. Prompt for a file name and write the printable output to that file.
  1523. @end table
  1524. By default, Todo uses @code{ps-print-buffer-with-faces} to make the
  1525. printable version; you can change this by setting the option
  1526. @code{todo-print-function}.
  1527. @node Legacy Todo Mode Files, GNU Free Documentation License, Printing Todo Buffers, Top
  1528. @chapter Legacy Todo Mode Files
  1529. Users of the original version of Todo mode will recognize from the
  1530. description in this user manual that, although the new version shares
  1531. with the original version the same basic user interface and handling of
  1532. todo items, there are some incompatible differences between them, such
  1533. as the done items sections (there are also other file format
  1534. incompatibilities behind the scenes that are normally not visible to
  1535. users).
  1536. The most significant incompatibility concerns the item prefix. In the
  1537. earlier version of Todo mode the prefix was the initial part of the item
  1538. string itself, so in order for the item to be displayable in the Emacs
  1539. diary, the prefix had to be a date/time pattern recognizable by the
  1540. diary (although the todo item also has its own date/time header).
  1541. Moreover, since all items had the same prefix string in the original
  1542. version, this means that either only all or no items could appear in the
  1543. Fancy Diary display on any given date. This considerably restricts the
  1544. practicality of including todo items in the diary. In contrast, the
  1545. current version of Todo mode uses overlays for item priority numbering
  1546. or prefixes, and item-specific diary-compatible date/time headers and
  1547. special marks for todo items to be excluded from the diary, so you can
  1548. determine for each item whether and when it appears in the Fancy Diary
  1549. display.
  1550. Due to these incompatibilities, files created with the original version
  1551. of Todo mode cannot be displayed or edited with the current version.
  1552. However, this version provides a function that converts the two main
  1553. types of files used by the original version into new-style valid todo
  1554. and archive files, respectively, and saves them in
  1555. @code{todo-directory}.@footnote{The original version of Todo mode also
  1556. allowed saving a file of top priority items, but since you can readily
  1557. create such a file with the new version, which is also more flexible,
  1558. no conversion is provided for this file.}
  1559. This conversion function is automatically called the first time you
  1560. invoke @code{todo-show} (i.e., before you have created a todo file with
  1561. the new version), and if it finds the old-style files, it offers to
  1562. convert them, making them the first new-style todo and archive files.
  1563. If you choose not to convert the old-style files at this time, you can
  1564. do so later by invoking the command @code{todo-convert-legacy-files}
  1565. (there is no key binding for it, since it shouldn't be necessary to use
  1566. it often). (A delicate part of the conversion concerns the customizable
  1567. format of item date/time headers in the old-style; see the documentation
  1568. string of @code{todo-legacy-date-time-regexp} for details.)
  1569. @node GNU Free Documentation License, , Legacy Todo Mode Files, Top
  1570. @appendix GNU Free Documentation License
  1571. @include doclicense.texi
  1572. @bye
  1573. @c End: