I noticed that todo.sh mistakenly picks up some random stuff as projects and contexts. The todo.txt specification is very lenient in what makes those (allowing any length of non-whitespace characters), but in practice, every user has its own idea of the set of used words. This change allows (expert) users to tweak the pattern (via TODOTXT_SIGIL_VALID_PATTERN), to be able to reduce the amount of "false positives" that listproj and listcon show.
Additionally, there's a (mainly unspecified) extension mechanism in the form of key:value, which often is used to implement custom "markers", like w:something to make a task blocked and waiting for "something". It would be nice to be able to refer to @contexts (and maybe also +projects), but the default syntax (which requires whitespace around those) doesn't allow it, and these context then don't show up in searches, which is unfortunate. The added TODOTXT_SIGIL_BEFORE_PATTERN and TODOTXT_SIGIL_AFTER_PATTERN allow to tweak the syntax to accommodate this.
The implementation just exchanges grep with a corresponding sed pipeline step, which shouldn't negatively affect the performance at all (as sed is one of the main commands used thoughout the script), but which allows for the additional matching flexibility.
Before submitting a pull request, please make sure the following is done:
[X] Fork the repository and create your branch from master.
[X] If you've added code that should be tested, add tests!
I noticed that todo.sh mistakenly picks up some random stuff as projects and contexts. The todo.txt specification is very lenient in what makes those (allowing any length of non-whitespace characters), but in practice, every user has its own idea of the set of used words. This change allows (expert) users to tweak the pattern (via
TODOTXT_SIGIL_VALID_PATTERN
), to be able to reduce the amount of "false positives" that listproj and listcon show. Additionally, there's a (mainly unspecified) extension mechanism in the form of key:value, which often is used to implement custom "markers", likew:something
to make a task blocked and waiting for "something". It would be nice to be able to refer to@contexts
(and maybe also+projects
), but the default syntax (which requires whitespace around those) doesn't allow it, and these context then don't show up in searches, which is unfortunate. The addedTODOTXT_SIGIL_BEFORE_PATTERN
andTODOTXT_SIGIL_AFTER_PATTERN
allow to tweak the syntax to accommodate this. The implementation just exchanges grep with a corresponding sed pipeline step, which shouldn't negatively affect the performance at all (as sed is one of the main commands used thoughout the script), but which allows for the additional matching flexibility.Before submitting a pull request, please make sure the following is done:
master
.fixes #XX
reference to the issue that this pull request fixes. No existing issue