ENH: TODOTXT_SOURCEVAR enables different source file for listcon.

To be used by todo_completion (to offer candidates from done.txt when there are no matches in todo.txt), and maybe by custom addons.
ENH: TODOTXT_SOURCEVAR enables different source file for listproj.
Add testing of todo_completion.

Before adding any more features to todo_completion, I feel like I need test coverage, so this is a first stab at testing the completion results, via a new test function test_todo_completion.
Some basic tests showcase the capabilities.

Note: test-lib.sh now uses arrays, therefore all tests must use /bin/bash, not /bin/sh to avoid errors when sourcing test-lib. For consistency with todo.sh, we should have used Bash everywhere, anyway. Also note that t2000-multiline.sh needs some more quoting to avoid "Bash: ambiguous redirect" errors.
Add tests for project and context completion.
ENH: completion offers projects and contexts from done.txt.

This is useful when there are no open projects/contexts any more, but one wants to re-use an existing name.
Merge duplicate test files for listproj.

t1260-listprj.sh was accidentally created; the tests should be in t1320-listproj.sh.
test-lib: Avoid empty line in diff when no completion.

There should be a trailing newline when there are completions (to avoid diff complaining about "no trailing newline", but not when there are no completions at all.
test-lib: Also check completion exit code.

The completion may unexpectedly abort somewhere.

Additionally, reformat the failure messages (don't prepend a "*", this should be reserved to mark the individual test runs) and use "compreply" instead of "output", so that it's already clear from the diff output that the completion is being tested.
Merge pull request #77 from inkarkat/complete-from-done

Complete from done
test-lib: Add test_todo_custom_completion variant.

This extension of test_todo_completion additionally takes the completion function to use, so that customized completions for todo.sh aliases can be tested.
ENH: completion can use different todo.sh locations and configurations.

This was previously not supported; todo_completion always used plain todo.sh from the PATH. Now it's possible to override the used executable (and configuration used through _todo_sh, set from a completion function wrapper.

Cp. http://tech.groups.yahoo.com/group/todotxt/message/4003
test-lib: Also document test_expect_code.
test-lib: Allow completions containing whitespace.

This is necessary to test the completion of task text.
Add test for task number completion.
Add more test cases for arguments and options completion.
Add test for todo file completion.
Add test for custom add-on action completion.
ENH: Better completion for custom add-ons via new listaddons command.

The todo_completion had the problem that it didn't consider the todo.cfg itself for the location of TODO_ACTIONS_DIR, it just tried the default location or a globally exported config value. With the injection of custom configuration now in place, we can actually delegate the listing to todo.sh itself.
The added built-in "listaddons" command is used for that; it may also be helpful for troubleshooting or to find out about available add-ons. (But the help / shorthelp commands offer more information.)

Additionally, completion is now more precise; only executable actions and no subdirs are listed now; this is also covered by the enhanced test.

The last bonus: The custom add-on actions are now only determined when there's actually completion of commands.
FIX: task number completion doesn't work on OS X.

The recently added tests revealed that. Because of the sed \+ bound. As in  f3fc18af6b80797e44903521a994218f98f9c022, fall back to the \{1,\} basic regexp.
Merge pull request #80 from inkarkat/complete-enhancements

Complete enhancements