diff --git a/ChangeLog b/ChangeLog index a523a41bc..d574360be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2.4.3 () - +- TW-70 urgency.user.keyword..coefficient=... - TW-1279 Make default.* not apply to recurring tasks. - TW-1287 Make default.* not apply to synced tasks. - TW-1578 Bash tab completion problems on first run diff --git a/NEWS b/NEWS index a32027b59..f4714695a 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ New configuration options in taskwarrior 2.4.3 - Setting 'bulk' to zero is interpreted as infinity, which means there is no amount of changes that is considered dangerous. + - The 'urgency.user.keyword..coefficient' setting allows tasks with + specific words in the description to have adjusted urgency. Newly deprecated features in taskwarrior 2.4.3 @@ -19,7 +21,9 @@ Newly deprecated features in taskwarrior 2.4.3 Removed features in 2.4.3 - - + - The 'priority.long' and 'priority.short' column formats are no longer + supported. + - The 'default.priority' setting is now 'uda.priority.default'. Known Issues diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index ce8c794a1..e6e593f11 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -1086,6 +1086,10 @@ Specific tag coefficient. .RS Specific project coefficient. .RE +.B urgency.user.keyword..coefficient=... +.RS +Specific description keyword coefficient. +.RE .B urgency.uda..coefficient=... .RS Presence/absence of UDA data. diff --git a/src/Task.cpp b/src/Task.cpp index 353491f73..cae52cb3a 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -1677,6 +1677,16 @@ float Task::urgency_c () const if (hasTag (tag)) value += var->second; } + + // urgency.user.keyword..coefficient + if (var->first.substr (13, 8) == "keyword." && + (end = var->first.find (".coefficient")) != std::string::npos) + { + std::string keyword = var->first.substr (21, end - 21); + + if (get ("description").find (keyword) != std::string::npos) + value += var->second; + } } else if (var->first.substr (0, 12) == "urgency.uda.") { diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index f7481b7f6..4535a8471 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -238,6 +238,7 @@ int CmdShow::execute (std::string& output) i->first.substr (0, 8) != "default." && i->first.substr (0, 21) != "urgency.user.project." && i->first.substr (0, 17) != "urgency.user.tag." && + i->first.substr (0, 21) != "urgency.user.keyword." && i->first.substr (0, 12) != "urgency.uda.") { unrecognized.push_back (i->first);