diff --git a/ChangeLog b/ChangeLog index 9a0ca0392..1ed1645da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ + Improved man pages (thanks to Andy Lester). + Default .taskrc files are now largely empty, and rely almost completed on default values. + + Special tags are now documented, and the 'tags' command highlights them. + Fixed bug #427, preventing the task edit command to parse annotation dates with spaces. + Fixed bug #433, making task command output more consistent. diff --git a/NEWS b/NEWS index 5f58edfb4..2d9252351 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New Features in task 1.9.3 - Start and stop times for a task can now be recorded as annotations. - - + - Special tags 'nocolor' and 'nonag'. Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/doc/man/task.1 b/doc/man/task.1 index 991c6f496..3df9b59b7 100644 --- a/doc/man/task.1 +++ b/doc/man/task.1 @@ -84,7 +84,7 @@ number of tasks for each. .TP .B tags -Show a list of all tags used. +Show a list of all tags used. Any special tags used are highlighted. .TP .B summary @@ -269,7 +269,14 @@ task del 1,4-10,19 .TP .B +tag|-tag Tags are arbitrary words associated with a task. Use + to add a tag and - to -remove a tag from a task. A task can have any quantity of tags +remove a tag from a task. A task can have any quantity of tags. + +Certain tags (called 'special tags'), can be used to affect the way tasks are +treated. For example, is a task has the special tag 'nocolor', then it is +exempt from all color rules. The supported special tags are: + + +nocolor Disable color rules processing for this task. + +nonag Completion of this task suppresses all nag messages. .TP .B project: diff --git a/src/command.cpp b/src/command.cpp index 63acfb3f5..b3ad482fc 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -378,6 +378,9 @@ int handleTags (std::string &outs) unique[*tag] = 1; } + bool use_color = context.config.getBoolean ("color") || + context.config.getBoolean ("_forcecolor"); + if (unique.size ()) { // Render a list of tags names from the map. @@ -385,8 +388,7 @@ int handleTags (std::string &outs) table.addColumn ("Tag"); table.addColumn ("Count"); - if (context.config.getBoolean ("color") || - context.config.getBoolean ("_forcecolor")) + if (use_color) { table.setColumnUnderline (0); table.setColumnUnderline (1); @@ -394,11 +396,19 @@ int handleTags (std::string &outs) table.setColumnJustification (1, Table::right); + Color bold ("bold"); foreach (i, unique) { int row = table.addRow (); table.addCell (row, 0, i->first); table.addCell (row, 1, i->second); + + // Highlight the special tags. + if (use_color && (i->first == "nocolor" || + i->first == "nonag")) + { + table.setRowColor (row, bold); + } } out << optionalBlankLine ()