From 2c5f590fed88d9d999d4f270f53e8687ab9d63f9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Dec 2009 11:48:09 -0500 Subject: [PATCH 1/2] Feature - Special tags - Implemented the 'nocolor' special tag. --- src/rules.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rules.cpp b/src/rules.cpp index 44b484574..bea72ad1d 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -55,6 +55,10 @@ void initializeColorRules () //////////////////////////////////////////////////////////////////////////////// void autoColorize (Task& task, Color& c) { + // The special tag 'nocolor' overrides all auto colorization. + if (task.hasTag ("nocolor")) + return; + // Note: fg, bg already contain colors specifically assigned via command. // Note: These rules form a hierarchy - the last rule is King. From 64c643920ffdc6b3da6cef13eec61ed3c566e8fd Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Dec 2009 11:54:23 -0500 Subject: [PATCH 2/2] Feature - Special tags - Implemented the 'nonag' tag that prevents nag messages for a task. --- ChangeLog | 2 ++ src/recur.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c43c91078..537e47d9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ + Added feature #341 that makes explicit references to the task and taskrc man pages, both in the auto-generated .taskrc file and the version command output (thanks to Cory Donnelly). + + Added special 'nonag' tag that suppresses nag messages for a task. + + Added special 'nocolor' tag that suppresses colorization rules for a task. + Fixed bug that showed a calendar for the year 2037 when 'task calendar due' was run, and there are no tasks with due dates. + Fixed bug #316 which caused the timesheet report to display an oddly sorted diff --git a/src/recur.cpp b/src/recur.cpp index 6be0927a1..c4f6438d7 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -399,8 +399,15 @@ int getDueState (const std::string& due) } //////////////////////////////////////////////////////////////////////////////// +// Returns a Boolean indicator as to whether a nag message was generated, so +// that commands can control the number of nag messages displayed (ie one is +// enough). bool nag (Task& task) { + // Special tag overrides nagging. + if (task.hasTag ("nonag")) + return false; + std::string nagMessage = context.config.get ("nag", ""); if (nagMessage != "") {