]> Joshua Wise's Git repositories - tdl.git/blame - tdl.texi
Print 'danger warnings' based on deadline proximity.
[tdl.git] / tdl.texi
CommitLineData
7024e37b
JW
1\input texinfo
2@c {{{ Main header stuff
3@afourwide
4@paragraphindent 0
5@setfilename tdl.info
6@settitle User guide for the tdl program
7@c @setchapternewpage off
8
9@ifinfo
10@dircategory Utilities
11@direntry
12* tdl: (tdl). To-do-list management utility
13@end direntry
14@end ifinfo
15
16@titlepage
17@sp 10
18@title The tdl program
19@subtitle This manual describes how to use
20@subtitle the tdl program for managing to-do-lists.
21@author Richard P. Curnow
22@page
23@vskip 0pt plus 1filll
24Copyright @copyright{} 2001,2002,2003,2004,2005 Richard P. Curnow
25@end titlepage
26
27@contents
28@c }}}
29
30@ifnottex
31@node Top
32@top
33@menu
34* Introduction:: What the tdl program does
35* Installation:: Compiling and installing the software
36* Usage:: Quickstart guide and examples of use
37* Reference:: Reference section
38@end menu
39@end ifnottex
40
41
42@c {{{ Introduction
43@node Introduction
44@chapter Introduction
45tdl is a lightweight program for managing a 'to-do' list of pending jobs that
46you have.
47
48It supports the following features :
49@itemize @bullet
50@item 1 database per directory, or per tree of directories (tdl searches up
51through parent directories to find the database, so you can have one per
52project, for example.)
53
54@item add new entries, mark them done, edit the text of entries
55
56@item add a new entry and immediately mark it done (e.g. to log tasks you did
57which you tackled immediately you got them.)
58
59@item organise the entries in a tree structure (sub-tasks of other tasks etc)
60
61@item move the tasks around and re-organise the hierarchy.
62
63@item list the tasks in the database (default listing excludes 'done' tasks,
64but these can be shown too if desired). The listing is in colour by default,
65with monochrome output as an option.
66
67@item allows entries to be prioritised (priorities shown in different colours
68on listing). The listing can selectively show only entries at or above a given
69priority level.
70
71@item the start time for tasks can be set, to allow for 'deferred' tasks with
72start times in the future. Such tasks are excluded from the default listing.
73
74@item tasks can be marked 'postponed' to avoid them cluttering up the normal
75listing.
76
77@item track date added and date completed for each task
78
79@item generate report of tasks completed in a given earlier time period (useful
80if you have to produce a weekly summary of your work done, for example)
81
82@item import and export entries, to allow splitting and merging of databases.
83
84@item written in C
85
86@item runs on a Linux console or in a terminal window. It currently generates
87a coloured listing (monochrome is an option), so a colour xterm or rxvt is
88preferred.
89
90@item tdl can run a single sub-command direct from the command line, or it can
91run in an interactive mode where several sub-commands can be used within a
92single run. If the GNU readline library is available at compile time, the
93interactive mode features command line editing and various completion and usage
94hint facilities.
95@end itemize
96@c }}}
97@c {{{ Installation
98@node Installation
99@chapter Installation
100This section discusses installation
101
102@menu
103* Build from source:: Installing tdl from source code
104* Packaging:: Notes for package builders
105@end menu
106
107@c {{{ Build from source
108@node Build from source
109@section Installing tdl from source code
110The procedure for installing tdl from source code is as follows:
111
112@enumerate
113@item @strong{Unpack the sources}
114@example
115gunzip < tdl-1.0.tar.gz | tar xvf -
116cd tdl-1.0
117@end example
118
119@item @strong{Configure the makefile}
120
121tdl does not use a @code{./configure} mechanism (yet!) to configure options.
122You have to manually edit @file{Makefile}. The variables you may want to edit are
123
124@table @samp
125@item CC
126The choice of C compiler
127@item CFLAGS
128The choice of flags to pass to the C compiler
129@item prefix
130The parent directory where the binaries and documentation will be installed.
131You'd normally set this to @file{/usr/local} or @file{/usr}, unless you use a
132stow or stow-like approach, or are building a distribution package.
133@item INC_READLINE
134If you want readline support in the interactive mode (highly recommended),
135uncomment the appropriate line in the Makefile, and if necessary edit the path
136for the include directory where @file{readline.h} and @file{history.h} can be
137found. Note that a @file{readline} subdirectory is assumed to be suffixed onto
138whatever path you define.
139@item LIB_READLINE
140Likewise, edit the path for the directory where @file{libreadline} and
141@file{libhistory} can be found.
142@end table
143
144@item @strong{Compile the sources}
145@example
146make
147@end example
148
149@item @strong{Install the software}
150@example
151make install
152@end example
153
154@item (Optional) @strong{Build the documentation}
155
156This assumes you have the @file{makeinfo} and @file{tex} tools on your path.
157@example
158make docs
159@end example
160
161@item (Optional) @strong{Install the documentation}
162
163Currently, there are no Makefile targets for this. Pick the documentation
164formats you want to keep and install them manually to the appropriate places.
165@end enumerate
166@c }}}
167@c {{{ Packaging
168@node Packaging
169@section Notes for package builders
170For building a Slackware package, you could follow the steps above except for
171the installation
172
173@example
174vi Makefile
175make
176make docs
177mkdir pkg
178make install DESTDIR=./pkg
179(copy appropriate docs into subdirectories of pkg)
180cd pkg
181makepkg tdl.tgz
182@end example
183
184Packagers for other distributions may be able to adapt this. (The point the
185example is making is that @file{Makefile} contains support for using a variable
186@var{DESTDIR} in this way.)
187
188An example spec file for RedHat packaging is in the file
189@file{tdl.spec.sample}.
190
191@c }}}
192
193@c }}}
194
195@c {{{ Usage
196@node Usage
197@chapter Usage
198This section contains examples of using tdl.
199
200@menu
201* Getting started:: Getting started with tdl
202@end menu
203
204@c {{{ Getting started
205@node Getting started
206@section Getting started
207This section shows how you can get started with tdl.
208
209Let's assume you have a working directory for a project, and you want to
210maintain a to-do list for things you need to do on that project. Let's assume
211the working directory for the project is @file{/home/foobar/myproject}. Then
212you'd start by entering the following commands into your shell:
213
214@example
215% cd /home/foobar/myproject
216% tdl create
217@end example
218
219Now, lets say you have some tasks to keep track of:
220
221@example
222% tdl
223tdl> add "Write user guide"
224tdl> add "Write release notes"
225tdl> add "Fix bug where empty data file causes core dump"
226tdl> exit
227%
228@end example
229
230The above sequence will add 3 tasks to your newly created database. A few days
231later, you might come back to the project and think "Hmmm. What did I need to
232do next?" You can enter
233
234@example
235% tdl list
2361 Write user guide
2372 Write release notes
2383 Fix bug where empty data file causes core dump
239%
240@end example
241
242This shows another feature of tdl. If you pass a sub-command (and its
243arguments, if any) on the tdl command line, tdl will execute just that command,
244and return you to your shell prompt. However, if you run tdl with no
245arguments, it will go into its interactive mode. For a single command like
246@command{list} in this situation, you'd probably find the direct method
247quicker.
248
249Suppose you fix the bug. Then you could enter
250
251@example
252% tdl done 3
253@end example
254
255after which the list command would only show the first two tasks as still being
256open, like this:
257
258@example
259% tdl list
2601 Write user guide
2612 Write release notes
262%
263@end example
264
265The @command{add}, @command{list} and @command{done} commands may be all that
266you need in some cases. However, another useful command is @command{report},
267which will summarise all the tasks you completed in a given period. For
268example, you could list everything you completed in the last 7 days like this
269
270@example
271% tdl report 7d
272- Fix bug where empty data file causes core dump
273%
274@end example
275
276The other commands in tdl are mostly to do with changing the order of tasks in
277the database, assigning them priorities, and so on.
278@c }}}
279
280@c }}}
281
282@node Reference
283@chapter Reference
284@menu
285* Start and Exit:: Starting and exiting tdl
286* Command line flags:: Flags that can be used from the shell command line
287* Node specification:: How to reference existing nodes
288* Command list:: Alphabetical list of all commands
289* Shortcuts:: Quick access to tdl commands from the shell
290* Interrupting:: How to make tdl stop whilst it is running
291* Location:: How tdl finds the database file to use
292* Completion:: Completion facilities
293* Datespec:: How dates are specified
294* Backup file:: How tdl saves a backup copy of the database
295* Index specification:: How indices can be specified
296@end menu
297
298@c {{{ Start and Exit
299@node Start and Exit
300@section Starting and exiting tdl
301tdl has a set of functions that can be accessed in two different ways:
302
303@itemize @bullet
304@item Directly from the command line
305@item Interactively
306@end itemize
307
308In the 'direct' method, the function and its arguments are provided on the
309command line. This mode is useful if you only want to perform a single
310operation. An example
311
312@example
313% tdl add "A task"
314%
315@end example
316
317The 'interactive' method is entered when the tdl command is run with no
318arguments. In this mode, many tdl operations may be performed within a single
319run of the program. This avoids loading and saving the database for each
320operation, which may have a small performance benefit. However, if the program
321is compiled with the readline library, the @key{tab} key will provide various
322completion functions. An example
323
324@example
325% tdl
326tdl> add "A task"
327tdl> exit
328%
329@end example
330
331When in interactive mode, these methods can be used to exit and return to the shell:
332
333@itemize @bullet
334@item The @command{exit} command (@pxref{exit command})
335@item Hitting @key{Ctrl-D} (i.e. end of file on stdin)
336@item Hitting @key{Ctrl-C}, @key{Ctrl-\} etc. The associated signals are
337caught by tdl and it will attempt to save the database. However, this method
338is more risky than the first two.
339@item The @command{quit} command (@pxref{quit command}). @strong{Caution:} this
340does not save the modified database back to the disk. Only use it if you want
341to discard all changes made in this tdl run.
342@end itemize
343
344@c }}}
345
346@c {{{ Command line flags
347@node Command line flags
348@section Command line flags
349@menu
350* -q:: Be quiet
351* -R:: Open the database read-only
352* -u:: Forced unlock
353@end menu
354
355@c {{{ Quiet mode
356@node -q
357@subsection Quiet mode
358If the @command{-q} flag is specified, various warning and informational
359messages will be suppressed.
360
361@example
362% tdl -q list
363@end example
364@c }}}
365@c {{{ Read-only mode
366@node -R
367@subsection Read-only mode
368If the @command{-R} flag is specified, the database will be opened in read-only
369mode. In this case, the database will not be locked, and all commands that
370modify the database will be barred.
371
372This flag can be used together with the @command{-q} flag if required.
373
374@example
375% tdl -R list
376% tdl -qR list
377@end example
378@c }}}
379@c {{{ Forced unlock
380@node -u
381@subsection Forced unlock
382If the @command{-u} flag is specified, the database's lockfile will be removed
383if it is found. This is mainly intended for use when an earlier run has left
384the database locked after a crash.
385
386Care shoule be taken that the database is not currently being accessed by a
387live process, otherwise updates could be lost by one or other of the processes.
388@example
389% tdl -u list
390@end example
391@c }}}
392@c }}}
393@c {{{ Node specification
394@node Node specification
395@section Node specification
396Many commands in tdl require you to refer to an existing entry, for example
397@itemize @bullet
398@item to add a child entry to an existing entry
399@item to mark an entry as being done
400@item and so on
401@end itemize
402
403There are two ways you can refer to existing nodes
404@itemize @bullet
405@item by the numeric path (as shown by @command{tdl list}).
406@item by negative numeric path (which is used to refer to a node counted from
407the end of its parent)
408@item by the start of the node's text, as long as enough is specified to
409identify the node unambiguously amongst its peers. In this case, the node must
410be preceded by a single '.' for many commands.
411@end itemize
412
413For example, if the database contains
414@example
415tdl> list
4161 foo
417 1.1 aaa
418 1.2 bbb
4192 fee
420 2.1 ccc
421 2.2 ddd
4223 bar
423 3.1 eee
424 3.2 fff
425@end example
426
427then @samp{tdl list 1} will show
428
429@example
430tdl> list
4311 foo
432 1.1 aaa
433 1.2 bbb
434@end example
435
436and @samp{tdl list .fe} will show
437@example
438.fe fee
439 .fe.1 ccc
440 .fe.2 ddd
441@end example
442
443@samp{tdl list .f} will fail since it is ambiguous which node (1 or 2) is being referenced.
444
445@samp{tdl list -- -1} will show
446@example
447-1 bar
448 -1.1 eee
449 -1.2 fff
450@end example
451
452(note that @samp{tdl list -1} has a different meaning (show 1 level and summarise subordinate levels), and shows
453@example
4541 [2/2] foo
4552 [2/2] fee
4563 [2/2] bar
457@end example
458
459@c }}}
460@c {{{ Command list
461@node Command list
462@section Alphabetical list of all commands
463This section describes each of the tdl subcommands.
464@menu
465* above command:: Move entries above (before) another entry
466* add command:: Add a new entry to the database
467* after command:: Move entries after (below) another entry
468* before command:: Move entries before (above) another entry
469* below command:: Move entries below (after) another entry
470* clone command:: Make a deep copy of one or more entries
471* copyto command:: Insert a deep copy of one or more entries into an existing entry
472* create command:: Create a new database in the current directory
473* defer command:: Modify starting time of one or more entries
474* delete command:: Remove 1 or more entries from the database
475* done command:: Mark 1 or more entries as done
476* edit command:: Change the text and/or start time of an entry
477* exit command:: Exit program, saving database
478* export command:: Export entries to another database
479* help command:: Display help information
480* ignore command:: Postpone/partially-remove 1 or more entries
481* import command:: Import entries from another database
482* into command:: Move entries to end of new parent
483* list command:: List entries in database (default from top node)
484* ls command:: List entries in database (default from top node)
485* log command:: Add a new entry to the database, mark it done as well
486* moveto command:: Move entries to end of new parent
487* narrow command:: Restrict actions to part of the database
488* open command:: Move 1 or more entries out of postponed state
489* postpone command::Make 1 or more entries postponed
490* priority command::Change the priority of 1 or more entries
491* purge command:: Remove old done entries in subtrees
492* quit command:: Exit program, NOT saving database
493* remove command:: Remove 1 or more entries from the database
494* report command:: Report completed tasks in interval
495* revert command:: Discard changes and reload previous database from disc
496* save command:: Save the database to disc and continue working
497* undo command:: Mark 1 or more entries as not done (cancel effect of 'done')
498* usage command:: Display help information
499* version command:: Display program version
500* which command:: Display filename of database being used
501* widen command:: Widen the part of the database to which actions apply
502@end menu
503@c }}}
504@c {{{ <--COMMANDS-->
505@c {{{ above command
506@node above command
507@subsection above command
508The @command{above} command is one of the commands used for re-ordering the
509entries in the database. The @command{above} and @command{before} commands are
510synonymous.
511
512The arguments of the @command{above} comamnd are:
513
514@example
515tdl> above <index_to_insert_above> <index_to_move> ...
516@end example
517
518The first argument is the index of the entry above which the other entries are
519to be moved. The entries corresponding the 2nd index onwards will be placed in
520argument order above the first entry.
521
522An example:
523@example
524tdl> list
5251 Task A
5262 Task B
5273 Task C
5284 Task D
529tdl> above 1 2 4 3
530tdl> list
5311 Task B
5322 Task D
5333 Task C
5344 Task A
535tdl>
536@end example
537
538You can move entries between levels in the hierarchy, with the restriction that
539you cannot move a node so that its new parent would be a descendent of itself.
540
541If you want to move entries to the end of the list (i.e. above the bottom of
542the list), you can use a zero as the index of the reference entry, for example
543
544@example
545tdl> list
5461 Task A
547 1.1 Task A_A
548 1.2 Task A_B
5492 Task B
5503 Task C
551tdl> above 1.0 3 2
552tdl> list
5531 Task A
554 1.1 Task A_A
555 1.2 Task A_A
556 1.3 Task C
557 1.4 Task B
558tdl>
559@end example
560
561@c }}}
562@c {{{ add command
563@node add command
564@subsection add command
565The @command{add} command is run as follows
566
567@example
568tdl> add [@@datespec] [parent-index] [priority] "Text for node"
569@end example
570
571In the simplest case of adding a new top-level entry to the database, with
572normal priority, starting now, this could be
573
574@example
575tdl> add "Wash the dog"
576@end example
577
578In a more complex case, to add a high priority entry underneath entry index 1,
579with the new entry coming live at 11a.m. next Friday, this would be
580
581@example
582tdl> add @@+fri-11 1 hi "Wash the dog"
583@end example
584
585If you have several entries to add at once, you can go into an @emph{add} mode.
586Enter a blank line to get back to the @t{tdl>} prompt.
587
588@example
589tdl> add
590add> Wash the dog
591add> Wash the car
592add>
593tdl>
594@end example
595
596To add an entry direct from your shell, there is an additional shortcut
597(assuming the appropriate symbolic link was created during the installation
598process):
599
600@example
601% tdla "Wash the dog"
602%
603@end example
604
605@c }}}
606@c {{{ after command
607@node after command
608@subsection after command
609The @command{after} and @command{below} commands are synonymous. See the
610description of @command{below} (@pxref{below command}).
611@c }}}
612@c {{{ before command
613@node before command
614@subsection before command
615The @command{above} and @command{before} commands are synonymous. See the
616description of @command{above} (@pxref{above command}).
617@c }}}
618@c {{{ below command
619@node below command
620@subsection below command
621The @command{below} command is one of the commands used for re-ordering the
622entries in the database. The @command{below} and @command{after} commands are
623synonymous.
624
625The arguments of the @command{below} command are:
626
627@example
628tdl> below <index_to_insert_below> <index_to_move> ...
629@end example
630
631The first argument is the index of the entry below which the other entries are
632to be moved. The entries corresponding the 2nd index onwards will be placed in
633argument order above the first entry.
634
635An example:
636@example
637tdl> list
6381 Task A
6392 Task B
6403 Task C
6414 Task D
642tdl> below 4 2 1 3
643tdl> list
6441 Task D
6452 Task B
6463 Task A
6474 Task C
648tdl>
649@end example
650
651You can move entries between levels in the hierarchy, with the restriction that
652you cannot move a node so that its new parent would be a descendent of itself.
653This is similar to the description for the @command{above} command
654(@pxref{above command}).
655
656@c }}}
657@c {{{ clone command
658@node clone command
659@subsection clone command
660The @command{clone} command can be used to make a deep copy of one or more
661entries and add them as new top-level entries in the database. You might use
662this if you have a task with a set of subtasks, and find that the same subtasks
663apply to some new task. You could copy the first task, and edit the new
664top-level task to change its text.
665
666The arguments of the @command{clone} command are:
667
668@example
669tdl> clone <index_to_clone> ...
670@end example
671
672An example is:
673@example
674tdl> list
6751 Wash things
676 1.1 Car
677 1.2 Dog
678tdl> clone 1
679tdl> edit 2 "Polish things"
680tdl> list
6811 Wash things
682 1.1 Car
683 1.2 Dog
6842 Polish things
685 2.1 Car
686 2.2 Dog
687@end example
688
689If you want the cloned entries to be children of an existing entry, use the
690@command{copyto} command (@pxref{copyto command}).
691@c }}}
692@c {{{ copyto command
693@node copyto command
694@subsection copyto command
695The @command{copyto} command is very similar to the @command{clone} command
696(@pxref{clone command}). The difference is that @command{copyto} inserts the
697newly created entries as children of an existing entry, rather than making them
698new top level entries.
699
700The arguments of the @command{copyto} command are:
701
702@example
703tdl> copyto <new_parent_index> <index_to_clone> ...
704@end example
705
706An example is:
707@example
708tdl> list
7091 Household jobs
710 1.1 Wash things
711 1.1.1 Car
712 1.1.2 Dog
713tdl> copyto 1 1.1
714tdl> edit 1.2 "Polish things"
715@end example
716@c }}}
717@c {{{ create command
718@node create command
719@subsection create command
720The @command{create} command can only be used direct from the shell command
721line. It is @strong{not} supported when tdl is used in its interactive
722mode.@footnote{This is to avoid confusion over which database file is being
723accessed if @command{create} were used after other commands had already
724been used in the same session.}
725
726Usually, the @command{create} command will create a new @file{.tdldb} file in
727the current directory. However, if the @var{TDL_DATABASE} environment
728variable is set when tdl is run, the path specified by that variable
729will be used instead and the database will be created there. In both
730cases, the @command{create} command will refuse to over-write an
731existing database; an error message will be generated if that is
732attempted.
733
734@example
735% tdl create
736@end example
737@c }}}
738@c {{{ defer command
739@node defer command
740@subsection defer command
741The @command{defer} command is used to modify the start-time of one or more existing entries. Its argument structure is
742
743@example
744tdl> defer @@<datespec> <entry_index>[...] ...
745@end example
746
747where the @samp{@@} on the datespec is optional because the argument is
748required, although the @samp{@@} can be included for consistency with other
749commands where a datespec is optional.
750
751An example of use is
752
753@example
754tdl> defer @@+fri 1 2.1... 5
755@end example
756
757which defers entries 1, 2.1 and all its children, and 5 until the following
758Friday.
759
760To list deferred entries, use @command{list -p}.
761
762To defer entries indefinitely, see @ref{postpone command}.
763
764To re-activate deferred or postponed entries, see @ref{open command}.
765
766@c }}}
767@c {{{ delete command
768@node delete command
769@subsection delete command
770This command is synonymous with the @command{remove} command (@pxref{remove command}).
771
772The argument structure is
773@example
774delete <entry_index>[...] ...
775@end example
776
777@c }}}
778@c {{{ done command
779@node done command
780@subsection done command
781The @command{done} command is run as follows
782
783@example
784done [@@<datespec>] <entry_index>[...] ...
785@end example
786
787The @command{done} command is used to mark one or more tasks as completed. Any
788number of task indices may be specified.
789
790The effects are as follows:
791
792@itemize @bullet
793@item
794The entries no longer appear on the default listing (produced by the
795@command{list} command without the @samp{-a} option).
796@item
797The entries are eligible to appear on the report list (@pxref{report command})
798@item
799The entries are eligible for removal by the purge command (@pxref{purge
800command})
801@end itemize
802
803If the string "..." is appended to an index, it means that entry and all its
804descendents. This provides a quick way to mark a whole sub-tree of tasks as
805being completed.
806
807No entry may be marked 'done' if it has any children that are still 'open'
808(i.e. not marked 'done'). (The @samp{...} form of the command marks the
809deepest entries first to bypass this.)
810
811@c }}}
812@c {{{ edit command
813@node edit command
814@subsection edit command
815The @command{edit} command is used to modify the text of an existing entry.
816Its argument structure is
817
818@example
819tdl> edit <entry_index> [<new_text>]
820@end example
821
822A single <entry-index> must be given. If <new-text> is provided, this replaces
823the text describing the specified entry. If no <new-text> is provided, you
824will be prompted with the old text to edit interactively. (This is only useful
825if the GNU readline library has been linked in.)
826
827An examples follows.
828
829To change the text for the entry with index 1,
830@example
831tdl> edit 1 "New description"
832@end example
833
834@example
835tdl> list
8361 Wash the dog
837tdl> edit 1
838edit (1)> Wash the dog (edit 'dog' to 'cat')
839tdl> list
8401 Wash the cat
841tdl>
842@end example
843
844(Note, in earlier versions, @command{edit} could be used to change the
845start-time of one or more entries. This is now handled by the @command{defer}
846command (@pxref{defer command}).)
847
848@c }}}
849@c {{{ exit command
850@node exit command
851@subsection exit command
852The @command{exit} command is used to exit from tdl when it is used in
853interactive mode. The @command{exit} command is not available in the command
854line mode, where it would not make sense. An example:
855
856@example
857tdl> exit
858%
859@end example
860
861The @command{exit} command writes any pending updates to the database before
862exiting. (Compare the @command{quit} command (@pxref{quit command}), which
863@strong{loses} all updates made during the current tdl run.)
864@c }}}
865@c {{{ export command
866@node export command
867@subsection export command
868The @command{export} command is run as follows
869
870@example
871export <filename> <entry_index> ...
872@end example
873
874It is used to export one or more tasks (and their subtasks) to another tdl
875database file. Perhaps you were keeping all your projects' to-do lists in one
876combined file, and decide you want to separate the list for a particular
877project.
878
879An example would be
880
881@example
882tdl> list
8831 Tasks for project X
8842 Tasks for project Y
885 2.1 Write manual
886 2.2 Write release notes
887tdl> export /home/foobar/project_y/.tdldb 2.1 2.2
888tdl> remove 2...
889tdl> exit
890@end example
891
892@c }}}
893@c {{{ help command
894@node help command
895@subsection help command
896The @command{help} command displays help information. When run without
897arguments, a list of valid commands is produced. Note, this list is slightly
898different depending on whether the @command{help} command is used through the
899interactive readline interface or straight from the shell.
900
901@example
902tdl> help
903tdl, Copyright (C) 2001-2004 Richard P. Curnow
904tdl comes with ABSOLUTELY NO WARRANTY.
905This is free software, and you are welcome to redistribute it
906under certain conditions; see the GNU General Public License for details.
907
908above : Move entries above (before) another entry
909add : Add a new entry to the database
910after : Move entries after (below) another entry
911below : Move entries below (after) another entry
912before : Move entries before (above) another entry
913done : Mark 1 or more entries as done
914edit : Change the text and/or start time of an entry
915exit : Exit program, saving database
916export : Export entries to another database
917help : Display help information
918import : Import entries from another database
919into : Move entries to end of new parent
920list : List entries in database (default from top node)
921log : Add a new entry to the database, mark it done as well
922priority : Change the priority of 1 or more entries
923purge : Remove old done entries in subtrees
924quit : Exit program, NOT saving database
925remove : Remove 1 or more entries from the database
926report : Report completed tasks in interval
927undo : Mark 1 or more entries as not done (cancel effect of 'done')
928usage : Display help information
929version : Display program version
930which : Display filename of database being used
931
932Enter 'help <command-name>' for more help on a particular command
933
934tdl>
935@end example
936
937If the @command{help} command is passed the name of a sub-command, it shows help for that command.
938
939@example
940tdl> help add
941Description
942 Add a new entry to the database
943
944Synopsis
945 add [@@<datespec>] [<parent_index>] [<priority>] <entry_text>
946
947<index> : 1, 1.1 etc (see output of 'tdl list')
948<priority> : urgent|high|normal|low|verylow
949<datespec> : [-|+][0-9]+[shdwmy][-hh[mm[ss]]] OR
950 [-|+](sun|mon|tue|wed|thu|fri|sat)[-hh[mm[ss]]] OR
951 [[[cc]yy]mm]dd[-hh[mm[ss]]]
952<text> : Any text (you'll need to quote it if >1 word)
953
954tdl>
955@end example
956
957The @command{help} command is synonymous with the @command{usage} command.
958
959@c }}}
960@c {{{ ignore command
961@node ignore command
962@subsection ignore command
963The @command{ignore} command puts one or more entries into an @emph{ignored}
964state. It is actually implemented in the same way as marking them as
965@emph{done}, but as though they were @emph{done} a very long time ago. Thus,
966ignored entries will be deleted by any subsequent purge operation.
967
968I added this feature because, when applying @command{remove} to several
969entries, I kept getting tripped up by the indices changing below the entry that
970was removed (I kept removing the wrong entries later by not using the revised
971indices). Instead, I can @command{ignore} them and rely on a periodic
972@command{purge} to clean up the database.
973
974Another use for the @emph{ignore} command would be to move moribund entries
975into a @emph{wastebasket} to stop them cluttering up the normal listing, but
976without removing them entirely in case you need to reprieve them later.
977
978The @command{ignore} command is run as follows
979
980@example
981ignore <entry_index>[...] ...
982@end example
983
984An example is
985@example
986ignore 20 21.6.3 25... 28.1
987@end example
988
989If you need to @emph{un-ignore} an entry, just @command{undo} it (@pxref{undo
990command}).
991
992@c }}}
993@c {{{ import command
994@node import command
995@subsection import command
996The @command{import} command is used as follows:
997
998@example
999import <filename>
1000@end example
1001
1002This command is used to merge entries from the TDL database @file{filename}
1003into the default database (i.e. the one that most of the other commands would
1004be accessing).
1005
1006You might use this command if you had a number of separate TDL databases, and
1007wanted to merge their entries to form one combo database.
1008@c }}}
1009@c {{{ into command
1010@node into command
1011@subsection into command
1012The @command{into} command is used to make one or more entries into sub-entries
1013of another entry. Its usage is
1014
1015@example
1016into <new_parent_index> <index_to_move> ...
1017@end example
1018
1019The following example shows it use
1020@example
1021tdl> list
10221 Task A
10232 Task B
10243 Task C
10254 Task D
1026tdl> into 1 3 2
1027tdl> list
10281 Task A
1029 1.1 Task C
1030 1.2 Task B
10312 Task D
1032tdl>
1033@end example
1034
1035The @command{into} command is closely related to @command{above},
1036@command{after}, @command{before} and @command{below}. In fact the following
1037three commands are equivalent
1038
1039@example
1040tdl> into N <indices> ...
1041and
1042tdl> above N.0 <indices> ...
1043and
1044tdl> before N.0 <indices> ...
1045@end example
1046
1047@c }}}
1048@c {{{ list command
1049@node list command
1050@subsection list command
1051The @command{list} command is used to display the tasks in the database. Its argument structure is:
1052
1053@example
1054list [-v] [-a] [-m] [-p] [-1..9]
1055 [<min-priority>]
1056 [<parent_index>|<search_condition>...]
1057@end example
1058
1059When run with no arguments, the list contains all tasks that are
1060@itemize @bullet
1061@item not marked 'done', 'ignored', 'deferred' or 'postponed',
1062@item at any levels of the database (i.e. any number of components in the task's index), and
1063@item of priority normal or higher.
1064@end itemize
1065
1066The arguments have the following functions:
1067
1068@table @samp
1069@item -v
1070This stands for @emph{verbose}. It means that more information will be shown
1071for each task.
1072@item -a
1073This stands for @emph{all}. It means that tasks which are 'done', or which are
1074'deferred' or 'postponed' (by having arrival times in the future), will be
1075shown as well as open tasks.
1076@item -p
1077This stands for @emph{postponed}. It means that tasks which are 'deferred' or
1078'postponed' are shown as well as open tasks.
1079@item -m
1080This stands for @emph{monochrome}. Normally, ANSI escape sequences are
1081inserted to show the list with colour coding. This flag stops these sequences
1082being generated.
1083
1084If you always want this option, set the @var{TDL_LIST_MONOCHROME} environment
1085variable to any value. If this variable exists, a monochrome listing will be
1086generated.
1087@item -1, -2, ..., -9
1088These options restrict the depth of the tree which is generated. For example,
1089with the @samp{-1} argument, only the first-level entries in the database are
1090shown. Sub-entries of these are shown by summary totals. See below for an
1091example.
1092@item <min-priority>
1093Normally (at least, if no indices are specified), only tasks with a priority of
1094at least @samp{normal} are shown in the list. If you specify this option,
1095tasks of at least the specified priority are shown. The values you can use are
1096@samp{urgent}, @samp{high}, @samp{normal}, @samp{low} or @samp{verylow}. Each
1097can be abbreviated to just its initial letter.
1098@item <parent_index...>
1099If you want to list just part of the database, you can specify the indices of
1100the leading entries for the parts you want to see. Any number of entries can
1101be included (you could even include an index twice if you wanted to for some
1102reason.)
1103
1104When you specify indices, the behaviour regarding priority changes. If no
1105@samp{<min-priority>} argument was given, the priority of a sub-entry must be
1106at least that of the entry with the given index for it to be shown. This is
1107most useful when the entire sub-tree has a lower than normal priority.
1108
1109If you use the @samp{-1} ... @samp{-9} options with this option, the depth is
1110counted relative to the depth of the indexed node that you specify.
1111@item <search_condition>
1112Each search condition specifies a case-insensitive substring match that is
1113applied to all parent indices further on in the arguments. (If no parent
1114indices are given, all the search conditions are and'ed together and applied to
1115filter all the nodes that would be shown according to the depth, priority etc
1116arguments).
1117
1118Each search condition takes one of the following forms
1119@example
1120/substring
1121/substring/1
1122@end example
1123
1124In each case, an entry will match if @samp{substring} is actually a substring
1125of the text of that entry. In the second form (where the number may be 0, 1, 2
1126or 3), a match occurs if there are up to that many errors in the substring. An
1127@dfn{error} is a single character inserted, removed or changed.
1128
1129This option is most useful if you have a large database and can remember you
1130have an entry somewhere containing particular word(s), but can't remember where
1131it is.
1132
1133If you need regular expression matching, the best approach would be to run
1134@command{tdll} from the shell and pipe the output to @command{grep}. The
1135internal matching does approximate matches with keys up to 31 characters.
1136
1137@end table
1138
1139The command is best illustrated by examples. Suppose the database contains
1140these entries
1141
1142@example
11431 bibble
1144 1.1 zzzz
1145 1.1.1 (DONE) yyyy
1146 1.1.2 wwww
11472 wibble
1148 2.1 xxxx
11493 wubble
1150@end example
1151
1152where @samp{wibble} and @samp{xxxx} have priority @samp{low}. The following
1153examples show the list command's behaviour.
1154
1155@example
1156tdl> list
11571 bibble
1158 1.1 zzzz
1159 1.1.2 wwww
11603 wubble
1161@end example
1162
1163(Entry 2 and its child are omitted due to priority. Entry 1.1.1 is omitted
1164because it is done.)
1165
1166@example
11671 bibble
1168 1.1 zzzz
1169 1.1.1 (DONE) yyyy
1170 1.1.2 wwww
11712 wibble
1172 2.1 xxxx
11733 wubble
1174@end example
1175
1176(Passing these arguments shows the missing entries)
1177
1178@example
1179tdl> list -1
11801 [1/1] bibble
11813 wubble
1182@end example
1183
1184(The list is limited to top level entries. The @samp{[1/1]} indices that entry
11851 has 1 open child out of a total of 1 children.)
1186
1187@example
1188tdl> list -1 1.1
11891.1 [1/2] zzzz
1190@end example
1191
1192(This lists the 1.1 subtree, showing that there is 1 open child out of a total
1193of 2 children.)
1194
1195@example
1196tdl> list /ww
1197 1.1.2 wwww
1198tdl> list /ww/1
1199 1.1.2 wwww
12003 wubble
1201tdl>
1202@end example
1203
1204(In the first case the substring @samp{ww} must occur exactly in the entry's
1205text. In the second case, the string @samp{wu} in @samp{wubble} matches
1206@samp{ww} with a single error so a match occurs.)
1207@c }}}
1208@c {{{ ls command
1209@node ls command
1210@subsection ls command
1211This is synonymous with the @command{list} command (@pxref{list command}). It
1212is provided for people who are too used to typing @command{ls} in their shell.
1213@c }}}
1214@c {{{ log command
1215@node log command
1216@subsection log command
1217The @command{log} command is very similar to the @command{add} command, except
1218that it immediately marks the new entry as done.It is the equivalent of using
1219@command{add} followed by @command{done} on the new entry. It is run as follows:
1220
1221@example
1222log [@@<datespec>] [<parent_index>] [<priority>] <entry_text>
1223@end example
1224
1225You might use the @command{log} command if complete a new task immediately but
1226want to make sure you log it for use in producing your weekly report (using
1227the @command{report} command, @xref{report command}.)
1228
1229If you have several entries to add at once, you can go into an @emph{log} mode.
1230Enter a blank line to get back to the @t{tdl>} prompt.
1231
1232@example
1233tdl> log
1234log> Wash the dog
1235log> Wash the car
1236log>
1237tdl>
1238@end example
1239
1240To add an entry direct from your shell, there is an additional shortcut
1241(assuming the appropriate symbolic link was created during the installation
1242process):
1243
1244@example
1245% tdlg "Wash the dog"
1246%
1247@end example
1248
1249(the ending @samp{g} on the shortcut was chosen as the final letter of the word
1250@samp{log}. The shortcut @samp{tdll} was already allocated for the
1251@command{list} subcommand.)
1252
1253@c }}}
1254@c {{{ moveto command
1255@node moveto command
1256@subsection moveto command
1257The @command{moveto} and @command{into} commands are synonymous. See the
1258description of @command{into} (@pxref{into command}).
1259@c }}}
1260@c {{{ narrow command
1261@node narrow command
1262@subsection narrow command
1263The @command{narrow} command can be used to limit the effects of later commands
1264to operate within a particular sub-tree of your database. Because the indices
1265you specify for the later operations have the common prefix omitted, this can
1266save typing if you have many changes to make within the same subtree.
1267
1268The usage of the @command{narrow} command is
1269
1270@example
1271narrow <new_root_index>
1272@end example
1273
1274The following example illustrates:
1275@example
1276tdl> add a
1277tdl> add b
1278tdl> add -1 c
1279tdl> add -1 d
1280tdl> add -1 e
1281tdl> list
12821 a
12832 b
1284 2.1 c
1285 2.2 d
1286 2.3 e
1287tdl> narrow 2
1288tdl[2]> list
12892 b
12902.1 c
12912.2 d
12922.3 e
1293tdl[2]> done 1 2
1294tdl[2]> list
12952 b
12962.3 e
1297tdl[2]> widen
1298tdl>
1299@end example
1300
1301If your listings are in colour, the common prefix is coloured in blue whilst
1302the paths below the root of the sub-tree are shown in the usual green. (In
1303monochrome mode, there is no distinction.)
1304
1305Whilst your view is narrowed, the index of the sub-tree root is shown in square
1306brackets between @samp{tdl} and @samp{>} (i.e. @samp{[2]} in the example
1307above).
1308
1309If you want to operate on the sub-tree root entry itself whilst you are
1310narrowed, you can use @samp{.} to specify its index (think: current directory
1311in Unix.)
1312
1313To reverse the effects of the @command{narrow} command, use the @command{widen}
1314command (@pxref{widen command}).
1315
1316This command is only available when @command{tdl} is being run interactively,
1317i.e. when you have a @samp{tdl} prompt. It is not available directly from the
1318shell (where it wouldn't make much sense).
1319@c }}}
1320@c {{{ open command
1321@node open command
1322@subsection open command
1323The @command{open} command is used to reverse the effect of the @command{defer}
1324command (@pxref{defer command}) and @command{postpone} command (@pxref{postpone
1325command}). Its effect is actually to set the arrival time of the entries to
1326the current time.
1327
1328The @command{open} command is used as follows
1329@example
1330open <index_to_reopen>[...] ...
1331@end example
1332
1333An example is
1334@example
1335open 20 21... 25.2
1336@end example
1337
1338@c }}}
1339@c {{{ postpone command
1340@node postpone command
1341@subsection postpone command
1342The @command{postpone} command is used to make 1 more more entries postponed
1343indefinitely. Its effect is actually to set the arrival time of the entries a
1344long way in the future (i.e. it's an extreme form of the 'deferred' feature
1345available in the @command{add} and @command{defer} commands.) Postponed entries
1346can be re-activated with the @command{open} command (@pxref{open command}).
1347
1348The @command{postpone} command is used as follows
1349@example
1350postpone <index_to_postpone>[...] ...
1351@end example
1352
1353An example is
1354@example
1355postpone 20 21... 25.2
1356@end example
1357
1358To postpone an entry until a specific time in the future, use the
1359@command{defer} command (@pxref{defer command}).
1360
1361@c }}}
1362@c {{{ priority command
1363@node priority command
1364@subsection priority command
1365The @command{priority} command is used to modify the priority of one or more entries. Its argument structure is
1366
1367@example
1368priority <new_priority> <entry_index>[...] ...
1369@end example
1370
1371The @samp{new_priority} argument is the new priority to be assigned. The
1372values you can use are @samp{urgent}, @samp{high}, @samp{normal}, @samp{low} or
1373@samp{verylow}. Each can be abbreviated to just its initial letter.
1374
1375You can specify at least one @samp{entry_index}. If an index is followed by
1376@samp{...}, the whole sub-tree under the referenced entry will be modified too.
1377For example,
1378
1379@example
1380tdl> priority high 2 4.1...
1381@end example
1382
1383will modify the priority of entry 2, entry 4.1, and all the entries under 4.1,
1384to high.
1385@c }}}
1386@c {{{ purge command
1387@node purge command
1388@subsection purge command
1389The @command{purge} command is used to remove outdated done tasks from the
1390database. For example, you might want to automatically remove everything you
1391completed more than 2 months ago.
1392
1393Its argument structure is
1394@example
1395purge <since_datespec> [<ancestor_index> ...]
1396@end example
1397
1398The @samp{since_datespec} argument specifies a date. All entries which were
1399marked 'done' before this date will be completely removed from the database.
1400
1401The default is to scan the entire database for done tasks that meet the date
1402constraint. You may specify one or more indices to limit the behaviour. In
1403this case, only the sub-trees headed by these indices will be considered for
1404purge.
1405
1406An example:
1407@example
1408tdl> purge -2m 3.1 5
1409@end example
1410
1411will purge all entries underneath entries 3.1 and 5 which were marked 'done'
1412more than 2 months ago.
1413
1414@c }}}
1415@c {{{ quit command
1416@node quit command
1417@subsection quit command
1418The @command{quit} command is used to exit from tdl when it is used in
1419interactive mode. The @command{quit} command is not available in the command
1420line mode, where it would not make sense. An example
1421
1422@example
1423tdl> quit
1424%
1425@end example
1426
1427The @command{quit} command @strong{DOES NOT} write any pending updates to the database before
1428exiting. (Compare the @command{exit} command (@pxref{exit command}), which
1429does write all updates made during the current tdl run.)
1430
1431The main use for the @command{quit} command would be to avoid damaging the
1432database if a serious error had been made.
1433@c }}}
1434@c {{{ remove command
1435@node remove command
1436@subsection remove command
1437The @command{remove} command is used to remove entries from the database. It
1438differs from purge @pxref{purge command} in that there is no date constraint,
1439and entries do not have to be marked 'done' to be removed. You might use
1440@command{remove} if an open tasks no longer needs to be performed.
1441
1442The argument structure is
1443@example
1444remove <entry_index>[...] ...
1445@end example
1446
1447You can specify one or more entry indices to remove. If an index is followed
1448by @samp{...}, tdl will remove the whole sub-tree based at that index.
1449
1450You cannot remove an entry that has sub-entries below it. (The @samp{...}
1451handling for indices removes the deepest entries first to bypass this.)
1452
1453An example:
1454@example
1455tdl> remove 1.5.4 19... 20
1456@end example
1457
1458will remove entries 1.5.4 and 20, as well as everything whose index starts with
145919.
1460
1461The @command{remove} command acts immediately to remove the specified entries
1462from the database. A less aggressive command with similar effects is
1463@command{ignore} (@pxref{ignore command}).
1464
1465The @command{delete} command (@pxref{delete command}) is provided as a synonmym
1466for the @command{remove} command.
1467
1468@c }}}
1469@c {{{ report command
1470@node report command
1471@subsection report command
1472The @command{report} command is used to show entries that were marked 'done'
1473within a specific time interval. Its argument structure is
1474
1475@example
1476report <start_datespec> [<end_datespec>]
1477@end example
1478
1479One or two date specifications may be given. If only the start_datespec is
1480provided, the end_datespec defaults to the present time. The format of both
1481arguments is described separately. @xref{Datespec}.
1482
1483For example, suppose you have to write a report on what you have done in the
1484last week. You could use
1485
1486@example
1487tdl> report 1w
1488@end example
1489
1490The report is produced in a tree structure, mirroring the database structure.
1491Entries which have 'done' children, but which haven't themselves been marked
1492done, have their text surrounded by @samp{[[} and @samp{]]}. For example
1493
1494@example
1495tdl> list -a
14961 bibble
1497 1.1 zzzz
1498 1.1.1 (DONE) yyyy
1499 1.1.2 wwww
15002 wibble
1501 2.1 xxxx
1502tdl> report 1w
1503- [[bibble]]
1504 - [[zzzz]]
1505 - yyyy
1506@end example
1507
1508You could cut-and-paste this text into your report, as a starting point that
1509you can reformat into a report. Alternatively, if you run the command direct
1510from the shell prompt line, you can redirect the output to a file,
1511
1512@example
1513% tdl report 1w > report.txt
1514%
1515@end example
1516
1517@c }}}
1518@c {{{ revert command
1519@node revert command
1520@subsection revert command
1521The @command{revert} command discards any changes made in the session and
1522reloads the in-memory database from disc. If you have used the @command{save}
1523command (@pxref{save command}) in the session, the database will revert to its
1524state at the most recent @command{save}. Otherwise it will revert to its state
1525when @command{tdl} was initially run.
1526
1527The @command{revert} command does not take any arguments.
1528@c }}}
1529@c {{{ save command
1530@node save command
1531@subsection save command
1532
1533The @command{save} command can be used to write the current in-memory database
1534out to the disc database file. The behaviour is currently equivalent to the
1535command @command{exit} followed by re-running @samp{tdl} from the shell.
1536
1537This command is useful if you tend to do long interactive tdl sessions. It guards against the risks of
1538@enumerate
1539@item accidentally typing @samp{quit} when you meant @samp{exit}
1540@item machine crashes
1541@item running @samp{tdl} in another window and seeing a stale copy of the database file.
1542@end enumerate
1543
1544The @command{save} command does not take any arguments.
1545@c }}}
1546@c {{{ undo command
1547@node undo command
1548@subsection undo command
1549
1550The @command{undo} command reverses the action of the @command{done} command
1551@pxref{done command}. You can use it to re-open entries, e.g. if you marked
1552them 'done' by mistake.
1553
1554Its argument structure is
1555@example
1556undo <entry_index>[...] ...
1557@end example
1558
1559You can specify one or more indices to act on. If an index is suffixed by
1560@samp{...}, tdl will re-open the entire sub-tree based at that index.
1561
1562@c }}}
1563@c {{{ usage command
1564@node usage command
1565@subsection usage command
1566The @command{usage} command is synonymous with the @command{help} command.
1567@xref{help command}.
1568@c }}}
1569@c {{{ version command
1570@node version command
1571@subsection version command
1572The @command{version} command shows the program version.
1573
1574@example
1575tdl> version
1576tdl V1.1
1577tdl>
1578@end example
1579@c }}}
1580@c {{{ which command
1581@node which command
1582@subsection which command
1583The @command{which} command displays the name of the current database file that
1584tdl is using. An example:
1585
1586@example
1587tdl> which
1588./.tdldb
1589tdl>
1590@end example
1591@c }}}
1592@c {{{ widen command
1593@node widen command
1594@subsection widen command
1595
1596This command reverses the effects of the @command{narrow} command
1597(@pxref{narrow command}).
1598
1599Its usage is:
1600
1601@example
1602tdl> widen [<n_levels>]
1603@end example
1604
1605The optional @samp{n_levels} parameter tells tdl how many levels to widen the
1606view. If the parameter is not specified, it defaults to 1. If you try to
1607widen more levels than the depth of the current sub-tree root node, the
1608widening will be silently limited to its depth.
1609
1610This command is only available when @command{tdl} is being run interactively,
1611i.e. when you have a @samp{tdl} prompt. It is not available directly from the
1612shell (where it wouldn't make much sense).
1613
1614@c }}}
1615@c }}}
1616@c {{{ shortcuts
1617@node Shortcuts
1618@section Shortcut forms of certain commands
1619For convenience, several shortcut commands are provided to access the most
1620common tdl operations. (These can be used from the shell command line.)
1621
1622@table @samp
1623@item tdla
1624This is a shortcut for @command{tdl add}, e.g.
1625
1626@example
1627% tdla "A new item"
1628@end example
1629
1630@item tdld
1631This is a shortcut for @command{tdl delete}.
1632
1633@item tdlg
1634This is a shortcut for @command{tdl log}.
1635
1636@item tdll
1637This is a shortcut for @command{tdl list}.
1638
1639@item tdls
1640This is another shortcut for @command{tdl list}.
1641
1642@end table
1643@c }}}
1644@c {{{ interrupting
1645@node Interrupting
1646@section Interrupting
1647Most programs will stop where they are if you hit @key{Ctrl-C}. This is also
1648true (normally) for tdl. However, tdl intercepts signals like this so that it
1649can try to write out the database when it is safe to do so. This avoids the
1650loss of updates made to the database during the current session.
1651
1652Because of this approach, it is possible that tdl can get stuck in an endless
1653loop if a bug arises. For this reason, tdl will exit forcibly if @key{Ctrl-C}
1654is pressed 4 times. After the third press, a warning message is printed.
1655
1656If tdl has to be terminated in this way, the database will not be written back
1657out. Therefore, any edits made in the current session will be lost. Also, a
1658stale lock file will be left behind. The @samp{-u} command line flag should be
1659used on the next run of tdl to force the removal of this stale lock file.
1660@c }}}
1661@c {{{ Location
1662@node Location
1663@section How tdl finds the databse file to use
1664If the @var{TDL_DATABASE} environment variable is set, its value is taken to be
1665the name of the database to use. This allows for two distinct modes of use:
1666@itemize @bullet
1667@item If you set @var{TDL_DATABASE} to a fixed filename (with a full path), you
1668can use a single database regardless of your current working directory.
1669@item If you set @var{TDL_DATABASE} to a relative path (e.g. @file{./.tdldb}),
1670you will always use a database in the current working directory.
1671@end itemize
1672
1673If this environment variable is not set, tdl finds the database by searching up
1674through the directory tree until it finds a file called @file{.tdldb}. The
1675idea is to allow for one database per project, by placing the database in the
1676parent directory of the project. Then as long as your current working
1677directory is anywhere within the project tree, the database will be found
1678during the search.
1679
1680The only exception to this is the @command{create} command, which always
1681operates in the current directory (unless @var{TDL_DATABASE} is set, in which
1682case this variable's value defines the path to use.)
1683
1684If you wish to share databases between directory trees in some other way, the
1685recommended method is to use symbolic (or hard) links to make a single database
1686appear to be in more than one directory.
1687
1688@c }}}
1689
1690@c {{{ Completion
1691@node Completion
1692@section Completion facilities
1693When tdl has been compiled to use the @emph{readline} library, the interactive
1694mode supports a number of completion functions, activated with the @key{tab}
1695key.
1696
1697In particular, the following are supported:
1698
1699@itemize @bullet
1700
1701@item @strong{Command completion}. If @key{tab} is pressed when the command
1702line is empty, a list of possible commands will be shown. If @key{tab} is
1703pressed when a partial command has been typed, the command will be completed
1704immediately if possible, otherwise a list of commands matching the
1705already-typed prefix will be shown.
1706
1707@item @strong{Help completion}. If @command{help} or @command{usage} is
1708already in the buffer, a list of commands will be shown(as above). The
1709@key{tab} completion works in the same way to complete the name of the command
1710you want a help summary for.
1711
1712@item @strong{Priority completion}. If @command{list} or @command{priority} is
1713at the start of the input buffer and the current word starts with a letter, tdl
1714will try to complete the name of a priority level if @key{tab} is pressed.
1715
1716@item @strong{Open task completion}. If @command{done} is at the start of the
1717input buffer, hitting @key{tab} will show a list of task indices that are still
1718open. If part of an index has already been typed, the open task indices for
1719which the typed characters are a prefix will be shown.
1720
1721@item @strong{Postpone completion}. If @command{postpone} is at the start of
1722the input buffer, hitting @key{tab} will show a list of tasks that may be
1723postponed. Tasks marked @emph{done} are excluded. If @command{open} is at the
1724start of the input buffer, hitting @key{tab} will show a list of tasks that may
1725be opened.
1726
1727@item @strong{Parameter hints}. If some other command is at the start of the
1728input buffer and @key{tab} is pressed, tdl will show a one-line summary of that
1729command's parameters.
1730
1731@end itemize
1732
1733
1734@c }}}
1735@c {{{ Datespec
1736@node Datespec
1737@section How dates are specified
1738@multitable @columnfractions .33 .66
1739@item @strong{Date specification} @tab @strong{Meaning}
1740@item -1h @tab exactly 1 hour ago
1741@item -2d @tab exactly 2 days ago
1742@item +1w @tab exactly 1 week in the future
1743@item +1m @tab exactly 1 month (30 days) in the future
1744@item +2y @tab exactly 2 years in the future
1745@item -1d-0815 @tab 08:15am yesterday
1746@item +1d-08 @tab 8am tomorrow
1747@item +1w-08 @tab 8am on the same day as today next week
1748@item +6h-08 @tab 8am on the day containing the time 6 hours ahead of now
1749@item .-08 @tab 8am today
1750@item .-20 @tab 8pm today
1751@item 20011020 @tab absolute : 12 noon on 20th October 2001
1752@item 011020 @tab absolute : 12 noon on 20th October 2001 (current century)
1753@item 1020 @tab absolute : 12 noon on 20th October 2001 (current century and year)
1754@item 20 @tab absolute : 12 noon on 20th October 2001 (current century, year and month)
1755@item 20011020-081500 @tab absolute : 08:15am on 20th October 2001
1756@item 20011020-0815 @tab absolute : 08:15am on 20th October 2001 (seconds=0)
1757@item 20011020-08 @tab absolute : 08:00am on 20th October 2001 (minutes=seconds=0)
1758@item 011020-08 @tab absolute : 08:00am on 20th October 2001 (minutes=seconds=0, current century)
1759@item etc @tab (see below)
1760@item -sun @tab 12 noon on the previous Sunday
1761@item +sat @tab 12 noon on the following Saturday
1762@item +sat-08 @tab 8am on the following Saturday
1763@item -tue-0815 @tab 08:15am on the previous Tuesday
1764@item etc @tab (see below)
1765@end multitable
1766
1767In the 'all-numeric' format, the rule is that dates can have fields omitted
1768from the start (assumed to be the current value), and times can have fields
1769omitted from the end (assumed to be zero, except if the hours figure is missing
1770it is assumed to be 12, since most work is done in the day.)
1771
1772In the 'weekday and time' format, the time rule is the same: missing minutes
1773and seconds are taken as zero and missing hours as 12. If the weekday is the
1774same as today, the offset is always 7 days in the required direction. If the
1775weekday is not the same as today, the offset will always be less than 7 days in
1776the required direction.
1777
1778In the 'relative' format, when a time is included as well, the procedure is as
1779follows. First the time is determined which is the given number of hours, days
1780etc away from the current time. Then the specified time on that day is used.
1781The main use for this is to specify times like '8am yesterday'. Obviously some
1782of the possible uses of this mode are rather far-fetched.
1783
1784For the weekday and relative formats, the sign is actually optional. The
1785default sign (implying past (-) or future (+)) will then be assumed depending on
1786the command as shown below:
1787
1788@multitable @columnfractions .2 .2 .6
1789@item @strong{Command} @tab @strong{Default} @tab @strong{Reason}
1790@item add @tab + @tab Add entries with deferred start times
1791@item edit @tab + @tab Add entries with deferred start times
1792@item defer @tab + @tab Modify start times of entries
1793@item done @tab - @tab Entries have been completed at some time in the past
1794@item log @tab - @tab Entries have been completed at some time in the past
1795@item report @tab - @tab Reporting on earlier completed tasks not future ones
1796@item purge @tab - @tab Tasks won't be completed in the future, so no need to purge future ones
1797@end multitable
1798@c }}}
1799@c {{{ Backup file
1800@node Backup file
1801@section How tdl saves a backup copy of the database
1802Whenever tdl writes a modified database to disk, it renames the previous
1803database by adding @file{.bak} on the end of the filename. Thus @file{.tdldb}
1804is renamed to @file{.tdldb.bak}.
1805
1806If you need to restore the previous @file{.tdldb} for any reason (e.g. a gross
1807mistake during editing, or if a bug causes it to be corrupted), you can
1808manually rename @file{.tdldb.bak} to @file{.tdldb}.
1809@c }}}
1810@c {{{ Index specification
1811@node Index specification
1812@section Index specification
1813Indices may usually be specified as negative values. This counts from the end of the list. The commonest use for this is to add children to an entry you've just typed, e.g.
1814
1815@example
1816tdl> add "Parent entry"
1817tdl> add -1 "Child entry"
1818tdl> add -1 "Child entry"
1819tdl> add -1.-1 "Grandchild entry"
1820@end example
1821
1822There is one example where negative indices are not handled in the usual way.
1823This is with the @command{list} command (@pxref{list command}). Here, a
1824negative index could be misinterpreted as a depth option. If you really want
1825negative indices for the @command{list} command, terminate the options with
1826@samp{--} before providing indices and search patterns.
1827@c }}}
1828
1829@bye
1830@c vim:cms=@c\ %s:fdm=marker:fdc=5:syntax=off
1831
This page took 0.277343 seconds and 4 git commands to generate.